• aberranticdesign

    (@aberranticdesign)


    Trying to add a widget to just my “recent events” page but it won’t accept it. It works on all single word pages. I’ve tried both “_” and “-” between the words. Any suggestions? One of my page names have an apostrophe in it, which I’d like to keep there. Any work around for it? The others are strictly letters.

    Thanks in advance!

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter aberranticdesign

    (@aberranticdesign)

    The code I was using is is_page('recent-events'). The page url is picjax.com. Another alternative I tried was excluding it from all pages but that one, but I ran into the same problem with other multi-word page names. Any help would be appreciated! 🙂

    alanft

    (@alanft)

    The pages title is “Recent Events” and the page ‘slug’ is “recentevents” so that should work, but you may need to use the wp_reset_query fix, as your template looks like it will call the sidebar after the loop

    http://codex.wordpress.org/Function_Reference/is_page#Cannot_Be_Used_Inside_The_Loop

    Thread Starter aberranticdesign

    (@aberranticdesign)

    I’m new at this, I’m sorry. So it should be written as is_page('recentevents'); wp_reset_query();? I was reading through the codex trying to figure it out but I keep getting this error message every time. I appreciate your help.

    “Parse error: syntax error, unexpected ‘;’ in /home/content/12/11058812/html/wp-content/plugins/widget-logic/widget_logic.php(284) : eval()’d code on line 1”

    alanft

    (@alanft)

    You’re almost there. Just is_page('recentevents') *should* do it, with the wp_reset_query fix option in the WL options
    http://wordpress.org/extend/plugins/widget-logic/screenshots/

    However ticking that option fix may not work and you may have to do a more complex WL code like this:

    wp_reset_query(); return is_page('recentevents');

    You need to put in an explicit return once you start doing logic more complex than a simple conditional tag

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Multi-word page names not working’ is closed to new replies.