Tag Info

New answers tagged

0

First of all, to resolve the javascript conflict I've set up a simple tl_custom.js under my theme js/ folder, with the following code jQuery(document).ready(function($) { // Remove handler set by themes/Divi/js/custom.js at line 2642 $( 'a[href*=#]:not([href=#])' ).off(); }); Then I add the script with the following code in functions.php ...


0

I might be off track here, but would removing the return false; from the javascript you posted help? return false; in a click function is like saying: event.preventDefault(); event.stopPropagation(); I think this is why your other function is not firing as there is no restriction to having multiple handlers bound to the same event on an element. ...


0

From a purely WordPress perspective, the only solution I see would be to copy the script to your child theme and make edits to it to remove the conflict. If the parent theme uses get_template_directory_uri to reference the path to the script, you'll also have to dequeue the original, and enqueue your modified version. If the script is loaded using ...


1

As already stated, the method you are using is the recommended way of doing it. Wordpress is written in such a way that it will always look for a template in a child theme first if there is an active child theme before looking for a template in the parent theme. So coming to performance, there is no impact on performance as these checks are performed ...


3

Actually, what you have described is the correct way to do things and there shouldn't be any noticeable impact on site speed and performance. Using child themes also has the benefit of allowing your changes to persist through theme upgrades.


0

The changes were being made in a stylesheet that is auto-generated by the parent theme. In the specific case of the Cherry parent theme (which is widely used in templates sold on themeforest, templatemonster etc), you cannot make stylesheet changes in reserved files such as main-styles.css (Despite them existing in a child theme). The solution is to either ...


0

You can change this line: 'orderby' => 'post__in', to this: 'orderby' => 'rand', Instead of showing the images in the same order as they were passed to 'post__in', they will show in random order each time the page is loaded. Keep in mind that if you update the child theme, your change will be overwritten. EDIT: The list of "pre ...


0

There are a few code edits you might have to do.. So lets go step by step.. Change in the places you use, <?php echo esc_url( home_url( '/' ) ); ?> to get the home page url, you can replace it with <?php get_site_url(); ?> which will get you your site URL. Next you are using the code of Site Title, <h1 class="site-title"><a ...


1

Your question is general, so I cannot answer it in details. If the parent theme enqueues some styles using get_stylesheet_directory_uri() in the path they won't be available in child theme. Then you should enqueue lacking stylesheets in your child's function.php using get_template_directory_uri() which will point to the parent theme directory. Some ...


0

From the Codex for pre_get_posts: pre_get_posts cannot be used to alter the query for Page requests (page templates) because 'is_page', 'is_singular', 'pagename' and other properties (depending if pretty permalinks are used) are already set by the parse_query() method. See: Query Overview. The recommended way to alter the main query for page requests is ...


1

Child theme templates starts working before Parent theme, so if any similar template files (similar to parent theme) exists it tries to override the parent theme's template - that's the core thing about child theme. The right way to enqueue new stylesheet in Child theme to make it THE Child Theme is the following: <?php function theme_enqueue_styles() { ...


4

Change this line: Template: Default Template to Template: wp_techgostore-theme-package As per the WordPress Codex, The Template line corresponds to the directory name of the parent theme


0

I would like to thank very much cybmeta for pointing me tho the other thread where I could find a solution to my problem. All works perfectly now and I am glad I received help so fast. I have modified my child functions.php like below: <?php function mytheme_scripts() { if ( ! is_admin() && ! in_array( $GLOBALS['pagenow'], array( ...


0

Try enqueuing your child theme's CSS like so: // Queue parent style followed by child/customized style add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles', PHP_INT_MAX); function theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'child-style', ...


0

You can use a more specific selector in your child theme's CSS so that it takes precedence. So instead of: .wp-caption { background: #2d2d2d !important; } Use: .entry .wp-caption { background: #2d2d2d; } You'll also want to be sure to enqueue your child theme stylesheet in your functions.php file if you aren't already. ...


0

As kaiser noted, you probably need a higher priority. add_action( 'wp_enqueue_scripts', 'load_alta_styles', 20 ); But if not, you can use wp_style_is to check and see after you do things if they are as expected. e.g. you might try: if ( wp_style_is( 'wp_listings_single', 'enqueued' ) ) { wp_dequeue_style( 'wp_listings_single' ); echo ...


0

Solved it thanks to [at]OnethingSimple and @milo. It was the W3 Total Cache plugin. I removed it from my server and everything works fine. Here's the path I had to take. Step 1 - went into my network admin on the site having the problem to confirm that W3TC was not activate or network active -- and it was not. Step 2 - walked through each of my other ...


4

All you can do is bump the priority of your hook: add_action( 'wp_head', 'dns_prefetch', 0 /* Highest priority */ ); but does this put my code just after the start of tag? No, but it will output before any other function attached to wp_head i.e. other <link />'s, most stylesheets, plugin scripts etc. To put it right after <head> you'll ...


1

No need for the filter. You can just call add_image_size later than the parent & it will overwrite.


1

You can add below code to your child theme. @media screen and (min-width: 59.6875em) { .site-content { float: left; margin-left: 0px; width: 70.5882%; } .sidebar { float: right; right:0; margin-right: 0px; max-width: 413px; width: 29.4118%; } body:before { ...



Top 50 recent answers are included