Displaying shortcode in footer
Your shortcode function is all wrong, should be: function copyright_shortcode() { return date(“Y”); }
Your shortcode function is all wrong, should be: function copyright_shortcode() { return date(“Y”); }
Properly enqueue the scripts, via callback hooked into the appropriate hook Use contextual conditional tags to determine when to enqueue For example, you’d do something like: function wpse135482_enqueue_scripts() { // Only enqueue this script on single post pages if ( is_singular( ‘post’ ) ) { wp_enqueue_script( $args ); } } add_action( ‘wp_enqueue_scripts’, ‘wpse135482_enqueue_scripts’ ); Further … Read more
get_footer() will bring footer.php, so including wp_footer() before the </body> will be more than enough in this case.
You will have to use wp_footer action for that. And check your pages in functions itself to perform some specific tasks. something like this. function my_footer_function() { if ( is_page( 1032 ) ) { // Do this } elseif ( is_page( 1033 ) ) { // Do that } else { // Do something else … Read more
The declaration in your footer tells WordPress to find the sidebar-social_media_sidebar_widgets.php file and apply it there. I think what you want is to declare: <?php dynamic_sidebar( ‘social_media_sidebar_widgets’ ); ?> in your footer.php file.
You can copy the footer.php file to your child theme and add condition to not display on home page. if (!is_home() || ! is_front_page()){ // All the codes which are not supposed to display on the front page or home page }
From OP comment: The footer.php file is all encrypted Do not download Themes from random sites. Only download Themes from trusted sources, for exactly this reason. The footer is encrypted, and the Theme is probably distributed under a license that prohibits modifying the footer. Thus, for both reasons, we cannot help you.
Have you perhaps copied in the admin bar links into the footer.php file by accident? At the bottom of footer.php you should see a function call “wp_footer();”.
This is not an error, it is a warning. You can make this go away by: Fixing the warning Write errors to the error log instead of the screen ( best practice ) To fix the error, I recommend looking at what’s hooking into wp_footer etc, or using a PHP debugger
There are a couple of options: Use a Plugin that adds contextual conditions to Widgets Only output the dynamic_sidebar() in the page template in question. For example, if your custom page template is named template-foobar.php, and the dynamic sidebar name is footer-text-widget: if ( ‘template-foobar.php’ == get_page_template() ) { dynamic_sidebar( ‘footer-text-widget’ ); }