Archived topic
Not display hook in sidebar
6 replies · Started by Eric on September 10, 2020
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 ;)
Sorry what am I looking at in the sidebar?
I'm seeing 5 sidebar widgets:
https://postimg.cc/4YF56Z51
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 :)