Support » How-To and Troubleshooting » the_content in sidebar

the_content in sidebar

  • Hi all!
    on my sidebar I have a new WP_Query to get only one post from a specific category. All works well (index, single, archive, pages) displaying correctly the result of the_content() of the main column (the main query) and the result of the_content() of my custom query in the sidebar.

    The problem is that only on pages and articles that have pagination (a page or an article distributed in more pages), the function “the_content()” of the sidebar display the same content of the main column.

    It seems that I could reset the content of “the_content()” of the main query. Or how can I fix this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Duplicated your problem on a page using the <!--nextpage--> construct.

    Had to use echo $post->post_content; in my test.

    I’d say that’s a bug. Feel like reporting that to Trac?

    Thanks MichaelH for your kind reply. 🙂

    I created a ticket here: http://core.trac.wordpress.org/ticket/9256

    Also, I’m looking that the first page does not break the function the_content() on the sidebar (the two contents are displayed correctly); the following pages, instead, (2, 3, 4, and so on) break it.

    I’m having this exact same problem as documented here:


    This bug was reported six months ago, yet it doesn’t seem to have been fixed yet.

    In my case, I cannot simply echo $post->post_content; because I’m trying to display a poll using WP-Polls, and WP-Polls only renders the content when it’s accessed through the_content(); when I echo the post_content, I see this:

    [poll id="28"]

    Which is the tag for WP-Polls to display a poll.

    Any ideas on how I can get this to work? Barring that, is there a conditional tag I can use to check if the post is showing paginated pages 2,3,4,5, etc, so that I can simply remove this block from display on those pages until the bug is fixed?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘the_content in sidebar’ is closed to new replies.