Tag Info

New answers tagged

0

To explain in short, many theme authors (I do this as well) tend to organise their functions in smaller, more manageble files outside of the normal functions.php file. It makes locating a certain function easier, and it also organise and group functions together which relates to a certain aspect regarding the site Quick example: In my theme, I have a file ...


1

When it comes to the template hierarchy, WordPress will indeed look in the child theme directory before loading from the main theme. For all other non-specific WordPress files (like functions and 3rd party includes), it's entirely up to the main theme to decide how to load them. Unless the theme is using locate_template to load these includes, or is ...


0

Just change only function that you want to edit. See this post 1)Copy (in full) the function you want to override from the parent theme. 2) Paste it into functions.php in the root of your child theme’s folder. If functions.php doesn’t exist, create it. 3) Rename the function from parent_theme_function to child_theme_function. 4) Deactivate the parent ...


0

If you want to override existing parent's css file, create the exact same file with exact same path and it will override it. Example: parentTheme/css/awesome_style.css To overwrite it you should create: parentTheme-child/css/awesome_style.css More info: Child Themes -> Template Files You could also add rules to the existing css, you can read more about ...


1

Ok, finally the support team answered my question, and if even if there's not a real solution, suggested a workaround. Since the answer is buried deep in the vendor user forum - link here - I'm sharing the solution here, just in case someone has the same problem with this or another theme. Basically it's a bug in the parent theme (Toolset Bootstrap), that ...


1

This seems to test properly for me. function register_home_sidebar() { /* Register the new sidebar. */ register_sidebar( array( 'id' => 'home-sidebar', 'name' => __('Home Sidebar'), 'description' => __( 'This sidebar will display only on the homepage.'), 'before_widget' => '<aside id="%1$s" class="widget ...


1

The child theme's main stylesheet (style.css) is loaded after the parent theme's main stylesheet (style.css), that is why you see the changes in the child theme overriding the parent theme style. As for the rest of your stylesheets, it is all about priority. What this means is, the custom stylesheet in your parent theme is loaded after your child theme's ...


1

First, you are confused. It is not the same "override a function" that remove a filter. Assuming that you want to remove a filter, I think that your code should be: function remove_html5_insert_image(){ remove_filter('image_send_to_editor','html5_insert_image', 10); } add_action('after_setup_theme','remove_html5_insert_image'); Note that the filter ...


0

Thanks to Brian Fegter. If this answer helps, please rate for Brian's answer right here above. This is a fully functional example of how to add things to the "header" by its own plugin. In this case, I am adding the properties of Facebook Open Graph for the Share and Like buttons. Just create a PHP file with the name specified in "Plugin Script" at the ...


1

Constants can not be redefined that easily. http://stackoverflow.com/questions/8465155/redefine-constants-in-php So, the constants from child themes will be used instead of parents one. Though, there will be a warning, but that shouldn't create any problem if you disable warning. You should add constants like this if you don't want any warning: if ( ...


1

You simply need to run your code on a higher priority than what the parent theme is, the default on add_action function is 10 so you can use: function s157343_unregister_widgets() { unregister_widget( 'Chocolat_Widget_New_Entrys' ); } add_action( 'widgets_init', 's157343_unregister_widgets', 20 ); This will unregister that widget. Of course, you can ...


0

A general note: A lot of things in WordPress can be configured. For example the name of the wp-content directory. The same goes for the name of the plugins and themes directory. And both can have multiple folders (with plugins defining them). About child themes and plugins: A plugin and a theme is (in general) pretty much the same thing. The (main) ...


0

The sidebar is created in two different places: The black strip is created from .site:before, check line 3910 of style.css #secondary actually displays the sidebar information, check line 3923 of style.css .featured-content, .site-content, .site-main .widecolumn provide left padding to the content area should you wish to dispose of that too.


2

My guess would be that you are remove the action before it is actually being added in the parent theme. The parent's theme functions.php file gets loaded after the child one so it looks like your removing something that is not there yet. The 3rd parameter in remove_action() is the priority. Try playing around with that number - the default is 10 - to see ...


0

Well, here's what I found. It doesn't quite explain why the editor was breaking, but it does explain how to add a button properly, without breaking the editor. The PHP code I was trying to add to functions.php actually needed to be added as a plugin. Combining directions from this StackExchange post and this tutorial, I created a WordPress plugin containing ...



Top 50 recent answers are included