WordPress.org

Ready to get started?Download WordPress

Forums

Widget Logic
Switches Out Widgets and Titles but Not Content? (2 posts)

  1. RUBYHAUS
    Member
    Posted 2 years ago #

    Here is my website I'm working on for reference so far. http://www.jonnyb.org Focusing on the Blog, Videos, and News sections.

    This is pretty stinking neat. It's really close to what I'm looking for. I got it working so far with the Titles at least showing up per category page your on. But however....

    I can't figure out the php hooks or calls to tell it to only show that categories posts or archives.

    For i.e.
    BLOG page should only have 1 Recent Post and 1 Archive.
    VIDEOS page should have at most 5 Recent Posts and Tons of Archives
    NEWS page should have 5 Recent Posts and at least 1/2 the amount of Archives as Videos does.

    But currently it still shows all posts and all archives and just changes out the titles. I know in reality it is changing out the widget which is perfect!!

    I tried the "wp_reset_query" fix as well. No go. I'm also using PageLines Platform Pro. Killer so far.

    I can't figure out the "Widget Logic" for those. I'm trying this:

    Widget#1 Recent Blog Posts
    is_category('blog') || (is_single() && in_category('blog'))
    Widget#2 Blog Archives
    is_category('blog') || (is_single() && in_category('blog'))

    Widget#3 Recent News Posts
    is_category('news') || (is_single() && in_category('news'))
    Widget#4 News Archives
    is_category('news') || (is_single() && in_category('news'))

    Widget#5 Recent Video Posts
    is_category('videos') || (is_single() && in_category('videos'))
    Widget#6 Video Archives
    is_category('videos') || (is_single() && in_category('videos'))

    Thanks in advance!!

    http://wordpress.org/extend/plugins/widget-logic/

  2. alanft
    Member
    Plugin Author

    Posted 2 years ago #

    "to only show that categories posts or archives"

    although you can use the widget_content filter to change the content of a widget, what you want to do here is probably too difficult to work as a filter. What you need (and for all I know they don't exist) are widgets that are 'context sensitive', only showing posts of the category you are looking at. sorry

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic