Add shortcode to Newspaper

Posted in: Newspaper
Post count: 54

I want to add a function that executes php code in the site, such as:

function test_func( $atts ){
return 'This is PHP from your functions file' ;
}
add_shortcode( 'test', 'test_func' );

Where is the recommendation to add this script? (Newspaper -> Theme panel -> ??? )
It is important to me not to get lost after the update.

Post count: 27744

Hello,

This type the code that you want to add, needs to be added in the funtions.php file.
You can set it in a child theme, there is a file called functions.php -> https://forum.tagdiv.com/the-child-theme-support-tutorial/, and then you will not lose your changes after the update

Thank you!

Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Newspaper’ is closed to new topics and replies.