Tag Info

New answers tagged

1

Just small nuggets of information that may help in simple setups (most notably the ones with no use plugins using ob_start): 1) You don't need the to put dns-prefetch calls as the first elements. What you need is to put them as soon as possible before any other element calling external resources. 2) Is actually possible to use negative numbers as priority ...


1

How can I make this code to display the meta tags at the top of the header section right after ? You probably can't. Typically wp_head() is called at the end of the </head> section, but that is theme dependent. You don't have any control. How can I put each meta tag on a separate line? Use double quotes and \n... $cjt = '<meta ...


-1

If you want to change more than just the stylesheet, your child theme can override any file in the parent theme: simply include a file of the same name in the child theme directory, and it will override the equivalent file in the parent theme directory when your site loads. For instance, if you want to change the PHP code for the site header, you can include ...


0

You can simply add those CSS to admin HEAD section, it's fast and easy solution. function jrl_styles() { ?><style type="text/css"> #jrl-wrap { width: 700px; padding: 3em; /* ... */ } </style><?php } add_action('admin_head', 'jrl_styles'); Or you can enque your CSS file like this: function ...


0

If you can wait for the parent theme's functions.php to load you can hook to the after_setup_theme or init actions and do what you need there.


2

The answer to which framework you should use is — no one knows. From code perspective there is certain degree of baseline theme functionality/experience — enforced by formal standards. Those things are recommended/required for inclusion into official theme directory, outside of that people can do things a little more lax. Frameworks exist for different ...


1

I have gone through your code and found that the function longform_the_related_posts displays 8 related posts. This function is defined in functions.php of parent theme and called in single.php. Thus, to override the function, follow below steps - 1. Create another function that displays 4 related posts in functions.php of child theme. (As you have ...


5

I gave a +1 to the @webtoure's answer because it gives you the right direction, however I think it lacks some checks. First of all it does not check that the theme that's being activated is a child theme, and does not check that the theme previously active is the parent theme of the child theme being activated. Per my understanding of OP these conditions ...


2

Plugins are not kept in the theme directory. It doesn't matter if you are using a child theme or not. Maybe you're asking a different question? Are you asking how to make a "child-plugin"? Plugins are generally kept here: wp-content/plugins. Whereas child themes and themes are kept here: wp-content/themes As far as "child-plugins" there is not an official ...


0

If "line 45" is the one that starts with $element->classes[] in your display_element method then try something like this: public function display_element( $element, &$children_elements, $max_depth, $depth = 0, $args, &$output ) { $element->has_children = ! empty( $children_elements[ $element->ID ] ); if ( ! isset( ...


0

The above code looks okay. I think the reason why you are getting 8 posts instead of 4 is that, you still have a code that fetches 8 posts in parent theme's functions.php. Try removing filter of parent theme in child theme. Like this - remove_filter('<filter_name>','<function_name>'); By doing this, parent themes's function would not take ...


0

I recently extended a child theme from tips and tricks for the twenty fifteen theme and i thought i should share how you can move the sidebar to the right with you guys. in the extended child theme i removed the sidebar completely from the twenty fifteen theme as some people prefer to use it that way. You can download the child theme here and change the code ...


0

I actully figured out the problem. I did not want the padding porperty i.e padding: 4rem;. So instead of overriding it in child them as padding: 0rem; I did not mention it. Therefore that property was not being overridden.


1

Is this: / just overwritten or is it a mistake in your code? max-width: 75%;/ It might cause to not work properly. Otherwise i will try a bit shady way, try to make your parent attributes !important.


0

First off, jquery is most likely already enqueued by the main theme. But if not, the proper way is to call wp_enqueue_script('jquery') in a function for the action hook wp_enqueue_scripts. Example: function enqueue_jquery() { wp_enqueue_script('jquery'); } add_action('wp_enqueue_scripts', 'enqueue_jquery'). This code would need to be added to the ...



Top 50 recent answers are included