Announcement

Collapse
No announcement yet.

I need to create a widget which appears only in specific sub-pages

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • I need to create a widget which appears only in specific sub-pages

    I have a page called "Portfolio"; and I create several sub pages (so it goes like this: www.popuridesign.com/portfolio/subpage1; www.popuridesign.com/portfolio/subpage2 etc ). I want to create a widget (call to action button) and hook it after page entry, but I only want it to appear on those subpages.

    I (think I) know how to create the widget and specify the hook location in DWB but not sure on how to set up the conditional.

    Any help will be appreciated

    Thank you

  • #2
    Conditional widget area - call to action tutorial from Carrie Dils:
    http://www.carriedils.com/add-widget-area-below-nav/

    Comment


    • #3
      There are also plugins to do that, if you´re not familiar with PHP or don´t want to deal with it:
      https://wordpress.org/plugins/widget-logic/
      https://wordpress.org/plugins/conditional-widgets/
      https://wordpress.org/plugins/dynamic-widgets/

      Comment


      • #4
        Don’t forget you can do a lot by using combinations of features like Conditionals and Labels along with Custom Hook Boxes or Widget Areas.

        You will find a number of articles in the KB by searching for those terms.

        http://dynamikdocs.cobaltapps.com

        Comment


        • #5
          Create a label in dynamik custom with a name like CTA or whatever you want to call it - then check the box to (Automatically create a Custom Conditional for this Label) - save changes

          Stay in dynamik custom - Go to Widget areas , create your widget with the hook genesis_after_entry or where you want it to appear - now select the conditionals from the dropdown box , you'll see one that's called - has_label_cta - tick the box to use that and add class and description if required and save.

          Go to any page you want this to appear on ie - your subpages - just below the editor you'll see the area "Dynamik Labels" - put a checkmark in the CTA box. You can tick the lable box on as many pages as you want , also multiple labels per page.

          Fill the widget with your code for the Call To Action in > appearance widgets

          Job done - rinse and re-repeat for as many labels as you want - no coding - no trawling google for code - no custom functions.


          Sit back and enjoy a coffee

          Comment


          • #6
            I ended up using the conditional-widget plugin to set up the conditionals. But I think I will try the "label" setting, thank you everyone for the help

            Comment


            • #7
              You should check out labels as soon as you can , I think you'll find you don't need that plugin at all. Once you use labels you'll realise how good they are.

              Comment

              Working...
              X