WordPress.org

Forums

Filtering index.php content by tag? (7 posts)

  1. timtastic
    Member
    Posted 8 years ago #

    I'm setting up a sort of CMS for a friend who needs an advertising portfolio:

    http://alexflint.net

    Understandably, WP defaults chronological ordering, but this is not ideal for my friend, who wants to display his best work first.

    I came up with the solution of creating a 'bestof' tag (using jerome's keywords) so we can hopefully display only the posts with that tag at the top.

    I initially tried replacing query_posts(); with query_posts('tag=bestof');

    This works to filter my content, but it causes the "Recent Posts" portion of the sidebar to malfunction.

    I have gotten this far but I'm pretty inexperienced with the WP code. Can anyone point me in the right direction?

  2. Andrew Ozz
    WordPress Dev
    Posted 8 years ago #

    Perhaps your friend should use pages instead of posts? Or create a page with links to his best posts and set it as "home". In WP 2.1 that's very straightforward.

  3. Doodlebee
    Member
    Posted 8 years ago #

    Another possible solution - if "Best Of" is updated frequently - you could just create a category for it and have that category be the only one displayed on the index page.

    Of course, if it's not updated very often, then AZ's solution would work just fine.

  4. alakhnor
    Member
    Posted 8 years ago #

    I guess you can use metadata for that.

  5. timtastic
    Member
    Posted 8 years ago #

    These solutions seem a bit too dramatic. All I really need is a way to filter results by a tag from within The Loop without putting the tag in query_posts()

    OR

    A way to make my index.php display results like my keywords.php, only with the serach term hidden.

  6. Andrew Ozz
    WordPress Dev
    Posted 8 years ago #

    Chech the Articles plugin by Alex King:
    http://alexking.org/projects/wordpress

  7. http://codex.wordpress.org/The_Loop#Multiple_Loops

    Examine some of those examples. They can show you how to write independent loops, which won't interfere with the main loop.

Topic Closed

This topic has been closed to new replies.

About this Topic