Site logo

Archived topic

Not display hook in sidebar

6 replies · Started by Eric on September 10, 2020

Viewing posts 1–7 of 7

Hi,
I make a hook to display a sharing article option.

function rezo_add_to_content( $content ) {
if( is_single() && ! empty( $GLOBALS['post'] ) ) {
if ( $GLOBALS['post']->ID == get_the_ID() ) {
$content .= 'all the content goes here';
}
}
return $content;
}
add_filter( 'the_content', 'rezo_add_to_content' );

I works but it appears as well in the sidebar within a views I made with Toolset. How Cani I avoid it ?
Thanks for your help

Hi there,

Not sure if I fully understand.

Any chance you can link us to the site in question?

You can edit the original topic and use the private URL field.

Let me know :)

Look the sidebar ;)

Hi,
In the sidebar there's a widget with Toolset views : “Articles Récents" with a pink title and you see that it repeats my hook at each post : “Partagez cet article“.
I want that this hook appears only at the end of the article and don't appear in the widget.

Hi,
I discover the power of "Elements" and it works now.
I close this topic
Have a good day !

No problem :)

This archived topic is closed to new replies.