Site logo

Archived topic

Hook in the middle of sidebar

3 replies · Started by Matic on December 3, 2020

Viewing posts 1–4 of 4

Hi,

let me start by saying how much I love Hooks in GeneratePress.

Is it possible to insert a hook in the middle of the sidebar?

Here an example link on my website: https://www.photutorial.com/stock-photography/
The child 1 and 2 (both ads) are manually inserted with Hooks (generate_before_right_sidebar_content) and then there are 3 (Popular posts) and 4 (about me), both of which were added Appearance > Customize > Add to sidebar.
Is it possible to rearrange these without making a whole sidebar with elements? (= I could create an entire Right sidebar with elements, but it would be a lot less convenient).
I would like the Popular posts to always be on top.

Cheers,
Matic

Hi there,

What kind of code are you adding using the hook?

Are you able to just add it using a custom HTML widget so you can arrange the widget however you want?

Let me know :)

Hi, it's is indeed just a line of an HTML code, but I do it using hooks because I want certain ads in certain categories. For example, I don't want Shutterstock adds in Category "Inspiration", and that's only possible to do with your hooks.

EDIT: I fixed the problem by also hooking the Popular posts PHP and giving it a priority 1, and 2 and 3 to the ads. Thinking back, that probably what you meant :)

Problem resolved.

Glad to hear :)

This archived topic is closed to new replies.