WordPress.org

Ready to get started?Download WordPress

Forums

Add WP Loop to footer or sidebar (4 posts)

  1. gspark
    Member
    Posted 6 years ago #

    I often run into issues where i'll be using code either in the footer or sidebar for posts and such but then they don't work, but then things work fine if in the index or blog pages, I'm assuming it has to do with the WP Loop ?

    Should we be adding the loop to the footer in order for things to work there ?

    one example is posts, if you have restriction on it, the user can see them in the regular blog pages but not in the footer as a recent post list, etc again is this a Loop issue ?

  2. moshu
    Member
    Posted 6 years ago #

    The_Loop - there are good examples about running multiple loops in a page...

  3. gspark
    Member
    Posted 6 years ago #

    I guess the next question would be what defines a page :)

    is a footer and sidebar considered a page ? Since they are two different files

    the loop seems to refer to the main pages like index, home, page, archive but I have found that this loop has not effect on items in footer or sidebar, it only appears to effect the main content area

  4. MichaelH
    Member
    Posted 6 years ago #

    No you can put a loop in almost any template file.

    Stepping into Templates
    Template Hierarchy
    Template_Tags/get_posts

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.