Site logo

Archived topic

Hook for blog first page only

3 replies · Started by Ryan on October 18, 2021

Viewing posts 1–4 of 4

Would there be a way I could insert a hook that would only display on the first page of the blog, but not any other pages. Right now I have it set to Location: Blog and Exclude: Archives. That mostly works but still displays on page 2 etc of the blog, I can't find a filter that would do exactly what I want. I'm sure I'm missing something, thanks!

Thanks for the help. So adding this function will completely bypass the display rules settings for the element correct? I might have missed it but how can I find the id of the element I want to add. Also, I wasn't clear with the description of that code, I want that element to display only on the first page of my blog, but not on the first pages of archives. Would I need to modify it a bit?

So adding this function will completely bypass the display rules settings for the element correct?

No - you can still set the display rule within the element. So try setting the display rule in the element to Blog then add the example code.

You can find the element ID in the URL of the element.

This archived topic is closed to new replies.