• Hi there,

    I would like to accomplish two tasks, and I am not 100% familiar with WP.

    1) How do I create a widget for latest entries, for each specific post category.

    ex: I have two blog categories: news and events. I would like to make a widget that shows Latest News, and another widget that shows Latest Events. Recent posts doesn’t work, as it puts both together.

    2) What is the code so this only shows on specific pages (say, home and blog)?

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Two plugins should accomplish your purposes:

    Widgets Reloaded and Widget Logic.

    Thread Starter solmartin

    (@solmartin)

    Thanks for your response Micah. I’ve installed the plugins, and am now left with this question:

    To use widget logic on a specific page, you type
    is_page(‘about’)

    What would I type if About had 15-20 pages nested inside it?

    Try this:
    global $post; return (is_page('about') || ($post->post_parent=="13"));

    Replace “13” with the page id of your about page. You can find this in the “edit pages” page.

    Thread Starter solmartin

    (@solmartin)

    Excellent! Thanks Micah!

    Thread Starter solmartin

    (@solmartin)

    one more question, which kind of loops me back to the first question posed:

    If I have a blog category I want to make a widget showing latest entries, what would I write for code? Using widgets reloaded, I have categories selected, and have it set to

    taxonomy; category
    order by: name
    include: news
    exclude: events.

    with these settings, all I get is a link to the blog… which means it’s working, but I need it to pull the latest article titles.

    Thanks for all the help!

    Thread Starter solmartin

    (@solmartin)

    Repost just in case this got missed:

    I have two blog categories: news and events. I would like to make a widget that shows Latest News, and another widget that shows Latest Events. Recent posts doesn’t work, as it puts both together.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Simple Widget Help’ is closed to new replies.