• Resolved conciseac

    (@conciseac)


    I am trying to display either Shortcode OR a Sidebar dependent on the WordPress category using OceanWP.

    > Option 1

    OK, so I installed the really great “Ocean Custom Sidebar” and I know that we can manually select the Sidebar we want to display on a “per post/ page” scenario.

    I was wondering, can we make this automated by category?

    So, if someone select “fruit” then the Sidebar that I created for “fruit” would appear on the right hand column?

    I am sure that this is possible with a functions.php command – or is it?

    ++++

    > Option 2
    Is is possible to display some Shortcode in the body of a post dependent on the WordPress category?

    • This topic was modified 6 years, 2 months ago by conciseac.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author oceanwp

    (@oceanwp)

    Hello,

    1. Yes, it is possible, see this function: https://docs.oceanwp.org/article/267-alter-the-main-sidebar-display

    2. Yes, you can easily do this with the OCean Hooks plugin.

    Thread Starter conciseac

    (@conciseac)

    Really amazing thanks very much. I always find that with OceanWP there is always (refreshingly) a solution.

    So – another question pls – is it possible to make “rules” for the hooks?

    For example, let’s say I have posts in these categories: “apples, pears, peaches”; is it possible to show shortcode via Hooks to posts in those categories?

    If so, that would be fantastic!

    Theme Author oceanwp

    (@oceanwp)

    Hello, unfortunately, no, you can choose to display a hook in your categories but not specific ones, I will see if I can do this in the future but right now it is not possible, sorry.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Possible to display OceanWP Sidebar OR Shortcode on certain categories’ is closed to new replies.