Problem in adding custom titles wordpress site (2 posts)

  1. sunilkumarp
    Posted 3 years ago #

    I am trying to add some custom titles in my page http://www.delpapafamily.com/new/#!/del-papa-family-farm/.

    I can print the page title in page.php using the code

    <?php echo "Name=".$post->post_name; ?>

    But when I put the same code in header, I am not able to get the page title.

    Please take a look at http://www.delpapafamily.com/new/#!/del-papa-family-farm/. Now this page prints the tiles from both header.php and page.php codes. But it does not show the page title from the header.php code.

    It is really urgent .



  2. James Kirk
    Posted 3 years ago #

    Heya sunilkumarp,

    When you say "put code in header" where exactly are you trying to display this "custom title"? Is it just in the <title> tag?

    If so, the code you have there needs to run in the loop, I think, in order to return something that displays, and I'm guessing you don't have a special loop running in your theme's header.

    Have you checked out Codex for WP_Title info? Might be something there to help.

    Cheers! :)

Topic Closed

This topic has been closed to new replies.

About this Topic