Need to add a shortcode to all pages and posts, help!

Hey guys i need to add a simple shortcode for another plugin to the bottom of the content of all pages and posts (only) for advanced authorship, only I can’t figure out the right way to do this in the PHP editor for the child theme. Using Pro version 2.3.6

Hi There,

Did you already setup a child theme?

After that add this code under functions.php file locates in your Pro child theme:

add_action( 'x_after_view_global__content', 'x_print_author' );
function x_print_author(){
	if( !is_home() && !is_front_page() && (is_page() || is_singular( 'post' )) ){
		echo do_shortcode( '[your-shortcode]' );
	}
}

Don’t forget to replace the [your-shortcode] shortcode with yours.

Hope it helps :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.