plugins - How to add post title to custom php?

I need to create a template to replace the default page of Events Made Easy. I created a php file for this template and

I need to create a template to replace the default page of Events Made Easy. I created a php file for this template and copied the page.php code to the new php file.

    <?php

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

get_header();
nectar_page_header( $post->ID );
$nectar_fp_options = nectar_get_full_page_options();

?>

<div class="container-wrap">
    <div class="<?php if ( $nectar_fp_options['page_full_screen_rows'] !== 'on' ) { echo 'container'; } ?> main-content">
        <div class="row">

            <?php

            nectar_hook_before_content(); 

            if ( have_posts() ) :
                while ( have_posts() ) :

                    the_post();
                    the_content();

                endwhile;
            endif;

            nectar_hook_after_content();

            ?>

        </div><!--/row-->
    </div><!--/container-->
</div><!--/container-wrap-->

<?php get_footer(); ?>

Now I need to get the title in there. I'm using the following code, but all I get is the title of the page itself and not of the post.

     <header class="entry-header">
             <?php the_post_thumbnail(); ?>
    <h1 class="entry-title"><?php the_title(); ?></h1>
  </header>

What am I missing?

Thank you.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744504654a4577634.html

相关推荐

  • plugins - How to add post title to custom php?

    I need to create a template to replace the default page of Events Made Easy. I created a php file for this template and

    2天前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信