WordPress can’t get jquery/unslider to work

$(document).ready(function(){ alert(“test”); }); It could be that your jQuery is working in compatibility mode. Try replacing $ with jQuery: jQuery(document).ready(function(){ alert(“test”); }); Edit: As per the author edit on the post: jQuery(document).ready(function(){ jQuery(‘.automatic-slider’).unslider({ autoplay: true }); });

Call to undefined function error in plugin

You can try following while you get such error: Searched for the php file with the function definition in it. Verified that the file exists. Verified that the require (or include) statement for the above file exists in the page. Also, verified the absolute path in the require/include is correct. Verified that the filename is … Read more

Multiple navigation menu in same location

Create multiple menus for each parent page and use an if condition to test which is the parent page and output that particular menu. You could keep the menu names the same as the parent page names so that any future pages created with new menus will still work. empty( $post->post_parent ) ? $post_parent_name = … Read more

Change MySQL PDO connection to a WPDB connection

You need to repalce the PDO connection object with WPDB object. And for the kind of query in your example, looks like the best way to do it is with $wpdb->getcol. Something like this (didn’t test): if ( isset( $_GET[‘term’] ) ){ global $wpdb; $term = filter_var( $_GET[‘term’], FILTER_SANITIZE_STRING, FILTER_NULL_ON_FAILURE ); if ( is_null( $term … Read more

How add body_class from wp_termmeta

First check it is product category archive page using is_tax Then use get queried object_id to get the current term ID Then after you can use get_term_meta to get class name. Example: add_filter( ‘body_class’, ‘lalka_custom_taxonomy_in_body_class’ ); function lalka_custom_taxonomy_in_body_class( $classes ){ if (is_tax(‘product_cat’)) { $custom_class = !empty( get_queried_object_id() ) ? get_term_meta(get_queried_object_id(), ‘custom-class’, true) : FALSE; if … Read more

Image Crop Not Working

I figured it out. I had to pass the image in as an ID rather than a URL. <?php $image_id = get_field(‘content_image_1’); $image_size=”home-left-column-block”; $image_array = wp_get_attachment_image_src($image_id, $image_size); $image_url = $image_array[0]; ?> <img src=”https://wordpress.stackexchange.com/questions/220603/<?php echo $image_url; ?>” alt=”<?php echo the_field(‘content_block_title_1’); ?>” height=”420″ width=”630″>

Code to insert code into single php

Confusing question. It sounds like you mean the plugin is checking for <!– code –> in the raw post content and using this as a trigger to indicate not to add the ad code. I think you need to identify the filter that the plugin is using to add the ad code so you can … Read more