Support » Fixing WordPress » Sidebar in the child pages also in the parent page using PHP

  • I have a WordPress website with pages with a lot of product descriptions, I devided those pages under two menu’s that have their own categorie pages. Al those product pages have a sidebar so you can easily navigate to other products.

    I want to add that sidebar to each of the two parrent pages as well. The sidebar apears only on the product pages and that is done by PHP coding,

    Can anyone help me to alter the PHP coding so the sidebars will also apear on the parrent page? Someone else did the PHP coding but I can’t reach him at the moment and I need it done before monday.

    Menu’s: “Beton” & “Betonstaal”

    PHP page code:

    If it is too much work I will wait for my friend to do it for me, Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,

    If understand well, “Beton” & “Betonstaal” are subcategories ?
    and the sidebar appears only in products (products are posts) ?

    If yes, you juste have to edit the single.php file.
    Then look for a ‘sidebar register’ like :
    <?php if ( !function_exists('dynamic_sidebar')...

    If you find it, locate it, copy/paste it in the category.php file at the same place that single.php.

    They are all pages and the pages “Beton” & “Betonstaal” are a description and introduction to the products. I want to add the sidebar on the pages “Beton” & “Betonstaal” as well for clearer navigation.

    The code I posted i found in page.php and this needs to be edited so it includes the pages “Beton”(Page id:35) & “Betonstaal”(Page id:211) I think.

    Thanks for your reaction!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Sidebar in the child pages also in the parent page using PHP’ is closed to new replies.