Jump to content


Photo
- - - - -

Fine-tuning Widget Appearance


  • Please log in to reply
4 replies to this topic

#1 WebWerx

WebWerx

    Advocate

  • Members
  • 546 posts
  • LocationCanada
  • Framework Version:2.2
  • Country: Country Flag

Posted 05 July 2012 - 03:49 PM

I am having some issues getting widgets to appear on just the Blog page of our site (and all blog post pages). I have used the Widget Logic plugin with great success throughout the site (thanks to the suggestion from @rangelone). But for some reason it does not work with Blog pages. I am stumped. Hence I am wondering if anyone has thought of a workaround to the issue. :-)

#2 Jenny

Jenny

    Advocate

  • Unicorn Store Dev

  • 2924 posts
  • LocationWV
  • Country: Country Flag

Posted 05 July 2012 - 07:05 PM

I haven't used widget logic myself so i'm not sure how you target page types/templates. Can you paste an example of the code you've used that works?

#3 WebWerx

WebWerx

    Advocate

  • Members
  • 546 posts
  • LocationCanada
  • Framework Version:2.2
  • Country: Country Flag

Posted 06 July 2012 - 01:53 AM

(@simple_mama) Hi Jenny: Widget logic works like this:

Please Login or Register to see this Hidden Content

to allow a widget to appear on a single page and like this:

Please Login or Register to see this Hidden Content

for multiple pages. The logic simply does not work on the Blog page (which uses the same template as a number of other pages - BTW). I am thinking that @pross (Simon) would know why as I think there is something a bit different about a Blog page.

#4 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 06 July 2012 - 02:05 AM

Assuming your read the widget logic docs, where the 3rd line of the description leads to the wordpress conditional codex page:

Please Login or Register to see this Hidden Content

. Where all the template conditions are listed, and your looking for the 1st one, is_home().

#5 WebWerx

WebWerx

    Advocate

  • Members
  • 546 posts
  • LocationCanada
  • Framework Version:2.2
  • Country: Country Flag

Posted 08 July 2012 - 04:01 PM

Thanks @pross (Simon). I can always count on you when it comes to PHP! I had read the doc and simply didn't think the Blog page was any different then a WP page. I know better now!

As I have the blog and posts pages that I want to show particular widgets on, I need to have 2 conditional tags. So I figured I'd post what I used in case others have the same issue:

Please Login or Register to see this Hidden Content


Use this in the Widget Logic option box on the widget in question:

Using Widget Logic, this will get a widget to appear on only your main Blog page and each Single Posts page.