Forums

[resolved] meta not showing on dynamic pages (7 posts)

  1. jwesseldyke
    Member
    Posted 9 months ago #

    I'm using a non-widget aware theme. On pages (page.php) my sidebar lists everything appropriately... Pages, categories, recent posts, meta, etc.

    On other pages (non page.php pages), everything displays correctly except meta disappears. In other words, clicking on the archive links, recent posts links or category links the sidebar looks the same except there is no meta...

    Meta information is part of my sidebar.php and both types of pages call the same sidebar.php but the information doesn't show up on any pages that are not page.php pages... Home, contact, about, etc.

    Both users who are logged in and not logged in have the same issue.

    Anybody have any ideas why this is happening?

  2. MichaelH
    moderator
    Posted 9 months ago #

    Some sidebar.php scripts use a Conditional Tags just before meta (login/register) type tags so look for an if (is_front()) or the like.

    If necessary you may have to paste your sidebar.php in a pastebin and report the link back here.

  3. jwesseldyke
    Member
    Posted 9 months ago #

    Hmm... Good tip. So here's the pertinent section of sidebar.php...

    <?php /* If this is the frontpage */ if ( is_home() || is_page() ) { ?>
    				<?php get_links_list(); ?>
    
    			<li><h2>Register / Login</h2>
                                    <ul>
                                      <?php wp_register(); ?>
                                      <li><?php wp_loginout(); ?></li>
                                      <?php wp_meta(); ?>
                                    </ul>
                            </li>
    			<?php } ?>

    I'm guessing, based on your thought about conditional tags that this is the issue... Only I don't know how to change it so meta shows up on all the pages, dynamic or static.

  4. jwesseldyke
    Member
    Posted 9 months ago #

    oh, just FYI I removed the if this is frontpage line and just get an error, likewise if I remove both that line and the get_links_list...

  5. MichaelH
    moderator
    Posted 9 months ago #

    <?php get_links_list(); ?>
    
    			<li><h2>Register / Login</h2>
                                    <ul>
                                      <?php wp_register(); ?>
                                      <li><?php wp_loginout(); ?></li>
                                      <?php wp_meta(); ?>
                                    </ul>
                            </li>

    [ moderated fixed to show the </ul> and </li> ]

  6. jwesseldyke
    Member
    Posted 9 months ago #

    OK... Got it... Thanks for the help...

    I was getting an error when I removed that line, which is why I thought it was required for something... Turns out, I missed the closing line after the section of code so I was getting a missing "}" error...

    All resolved. Thanks again.

  7. MichaelH
    moderator
    Posted 9 months ago #

    Good.

    As a reminder, template tag, wp_list_bookmarks(), replaces the deprecated get_links_list, so consider changing to the newer function.

Reply

You must log in to post.

About this Topic