My scripts-bundle.js file is getting sent to the browser as a stylesheet css file. Help!

Ok, I managed to solve this issue because I was using the wrong WP functions to point my child themes directory and thus my bundled javascript script. I cleared out my functions.php file and added the below and it all works now: function load_js_files() { wp_enqueue_script( ‘script’, get_stylesheet_directory_uri() . ‘/js/scripts-bundled.js’, array ( ‘jquery’ ), 1.1, … Read more

Add a series of checkboxes to theme options

Want some honest advice? Work from a better code base.. Though, it’s not your fault, there are hundreds of blogs with variations of similar code, i’m not sure where it originated, but i see similar code “alot”… If you can get by without the hand holding and just manage with a good code base, i’d … Read more

how to add custom fields in page

Edit: Came back on this post much later but I am updating this with more correct information. The following code will allow you to display the value of a custom field anywhere in your theme or plugin, as long as you are getting the correct post ID to pass to it. You would need to … Read more

Varying Search Result Pages

you can add an hidden filed to your search form and include a different template based on that: <form role=”search” method=”get” id=”searchsupport” action=”https://wordpress.stackexchange.com/”> <label class=”screen-reader-text” for=”s”>Search for:</label> <input type=”text” onfocus=”if (this.value == ‘Search’) {this.value=””;}” onblur=”if (this.value == ”) {this.value=”search”;}” id=”s” name=”s” value=”search” class=”search-form round”> <input type=”hidden” id=”searchsubmit”> <!– this is the magic field —> <input … Read more

How to load parent theme style.css?

At the top of your child themes style.css add: @import url(“../twentyeleven/style.css”); Obviously replace twentyeleven with your parent themes folder. 2016 – This practice has now been replaced by declaring the ‘Template’ in your theme stylesheet header: Template: twentyfifteen https://codex.wordpress.org/Child_Themes

Display a specific dynamic sidebar widgets on a specific page

I think what you might need is simply to run register_sidebar() in an ‘widgets_init’ hook. The TwentyTen theme has examples for register_sidebar() in its functions.php file, but here’s what it might look like: add_action( ‘widgets_init’, ‘twentyten_widgets_init’ ); function twentyten_widgets_init() { register_sidebar( array( ‘name’ => __( ‘News Sidebar’, ‘yoursite’ ), ‘id’ => ‘sidebar-news’, ‘description’ => __( … Read more