WordPress.org

Ready to get started?Download WordPress

Forums

Widget Logic
[resolved] Widget in homepage only (with static homepage) (8 posts)

  1. eyephone21
    Member
    Posted 1 year ago #

    Hello!
    Great code, i love it.
    I wanted a widget to appear in homepage only but ihad an issue with is_home(), i don't know if it's because i have a static page as homepage.

    After some tries (i'm not that code jedi) i found that using the id of the page worked, in my case i used is_page('77')

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

  2. eyephone21
    Member
    Posted 1 year ago #

    maybe somebody find this useful!

  3. Charmer83
    Member
    Posted 11 months ago #

    where do I find my page number?

  4. Charmer83
    Member
    Posted 11 months ago #

    got it figured out...

  5. eyephone21
    Member
    Posted 11 months ago #

    Good!
    To discover the number of the page (or post) in the dashboard's "pages" page all you have to do is hover the title of the desidered page and you'll see the number in the status bar, usually at the bottom of the browser, something like " .../wp-admin/post.php?post=520&action=edit"
    In this case 520 is the number you need.

  6. Charmer83
    Member
    Posted 11 months ago #

    yep that's how I got it, thanks... would you know how to have the widget only show on one page. I figured out one page but I have several more I don't want it on.

  7. eyephone21
    Member
    Posted 11 months ago #

    Sorry Charmer, english is not my language, so i didn't get you last post.
    The code is_page('77') means to show a widget in that page only.
    To avoid other widgets on a page you have to use the ! that reverse the logic, so, in this case you'll have to put !is_page('77')on all the widget that you want to hide on page 77 (but to display them on all others).

  8. Charmer83
    Member
    Posted 11 months ago #

    I got it figured out... thanks, it worked a different way.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags