Forums

"Posts Page" reference help (5 posts)

  1. matius
    Member
    Posted 2 years ago #

    Hello everyone.

    I've set my files up so that my home page is static and my posts page is entitled "Events Calendar".

    In header.php of my template, I am able to reference the Events Calendar page by way of "$wp_query->is_posts_page", but in page.php not so much.

    No amount of

  2. is_page, the_title, get_the_title, is_paged, or $wp_query->is_posts_page
  3. will work. I've tried using the slug, the actual page title, etc.

    It must be something simple. Any help very much appreciated...

  • MichaelH
    Volunteer
    Posted 2 years ago #

    Use this to dump your query vars:

    echo "<pre>"; print_r($wp_query->query_vars); echo "</pre>";

    You might want:

    echo get_query_var('p');

    or

    echo get_query_var('page_id');
  • matius
    Member
    Posted 2 years ago #

    Hi, none of those work (at least how I'm using them) in page.php for my posts page. It works for all other pages though.

    Appreciate the suggestion nonetheless.

  • MichaelH
    Volunteer
    Posted 2 years ago #

    Any of these Conditional Tags help?

  • matius
    Member
    Posted 2 years ago #

    Thanks for your help. Still feeling my way around here; created a custom template for that page & it works with the $wp_query. Wish I could explain better! Thanks again though -

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags