Forums

[resolved] Widget logic seems to not work on posts? (7 posts)

  1. graleh
    Member
    Posted 7 months ago #

    Hi,

    I have used widget logic since I want the tag cloud plugin to show only on blog posts. I am making a web page for a friend and I am using pages for presentation of her company. She also wants a blog with posts on her page so I have made a page called "blogg" and in settings, made this page as the static posts page.

    But the widget logic seem to not work here. It works on all the other pages, but not this, "blogg" which I have set as static posts page. Why?

    Thanks!

    Emelie

  2. alchymyth
    The Sweeper
    Posted 7 months ago #

    static posts page

    you haven't posted what conditional you are working with, but, try is_home()

  3. graleh
    Member
    Posted 7 months ago #

    I have tried them all: "It works on all the other pages, but not this, "blogg" which I have set as static posts page."

  4. alchymyth
    The Sweeper
    Posted 7 months ago #

    is 'blogg' using a custom page template?

    if so, you might be able to use the conditional tag for page templates:
    http://codex.wordpress.org/Function_Reference/is_page_template

    also, be aware that any queries in the template might be distorting the original querystring, so that the information is not available where widget-logic is checking it;
    try to add <?php wp_reset_query(); ?> at the top of the sidebar.php template.

  5. graleh
    Member
    Posted 7 months ago #

    Um, not sure. I haven't chosen any special page template. So I guess I am using the standard one?

    I have checked the reset query option, but it does not seem to work :/ I still cannot see the widget on page "blogg" :/

  6. entropy111
    Member
    Posted 3 months ago #

    Found a fix..two steps...

    1. add this code to your front-page.php file

    <?php
            //TO GET WIDGET LOGIC WORKING WITH FRONTPAGES
    	wp_reset_query();
    ?>

    2. Add "is_front_page()" in widget logic on teh widgets you want on the front (not really a step, but you know what im sayin).

    Hope this helps.

  7. graleh
    Member
    Posted 3 months ago #

    hi entropy111,

    Yep that worked, I forgot some settings :/

    Thank you very much :)

Reply

You must log in to post.

About this Topic