Print string to footer using wp_footer option

Do you have to use a variable for you script? I have done this in the past and has worked… // add script to the footer and break out of PHP function slider_option(){ ?> <script>script function data</script> <?php } ?> add_action(‘wp_footer’,’slider_option’); If this does not work make sure you have the footer hook in you … Read more

Change directory where get_header(), get_footer() and get_sidebar() look for templates

Simple solution, use get_template_part(). For example: get_template_part( ‘partials/footer’ ); Which would get the footer.php inside the partials/ directory. Another example: get_template_part( ‘partials/footer’, ‘home’ ); Which would get the footer-home.php inside the partials/ directory. One more example: get_template_part( ‘partials/footer/blog’ ); Which would get the blog.php inside the partials/footer/ directory.

Template part vs Sidebar (differences)

The get_sidebar($name); function loads sidebar template file sidebar-{$name}.php if no name in the prentacies is specified it loads the sidebar.php file. get_sidebar() and get_template_part() are almost identical, at the end they call locate_template() function that take care of loading from files. The only difference is the hook fired. If you use get_sidebar() for all your … Read more

How to edit footer

At first go to theme directory find inc>functions.php then search for “colormag_footer_copyright” edit this code bellow as you need: add_action( ‘colormag_footer_copyright’, ‘colormag_footer_copyright’, 10 ); /** * function to show the footer info, copyright information */ if ( ! function_exists( ‘colormag_footer_copyright’ ) ) : function colormag_footer_copyright() { $site_link = ‘<a href=”‘ . esc_url( home_url( “https://wordpress.stackexchange.com/” ) … Read more