custom changes removed after plugin update

If it’s just a CSS change, load your own CSS stylesheet to override their CSS. If it’s the HTML of the plugin, then you will need to look at filter hooks to see what you can change. Some plugins are developer friendly and supply some filter hooks allowing you to change various things the plugin … Read more

Override theme style with other CSS on a specific page

You want the plugins style sheet to over ride your themes style sheet conditionally ( on one page). Dequeue your themes style sheet for a specific page conditionally. add_action( ‘wp_enqueue_scripts’, ‘remove_default_stylesheet’, 25 ); function remove_default_stylesheet() { if ( is_page( page id or slug) ) { wp_dequeue_style( ‘original-enqueue-stylesheet-handle’ ); wp_deregister_style( ‘original-register-stylesheet-handle’ ); wp_register_style( ‘new-style’, plugins_url(‘stylesheet.css’, __FILE__) … Read more

jQuery.accordion isn’t a function even when enqueued

The 3rd parameter in the call to wp_register_script() should be an array of dependencies – not a string. Change this: wp_register_script(‘fl-custom-js’, get_template_directory_uri() . ‘/faq/faq.js’, ‘jquery-ui-accordion’, ”, true); To: wp_register_script(‘fl-custom-js’, get_template_directory_uri() . ‘/faq/faq.js’, array(‘jquery-ui-accordion’), ”, true);

Removing jQuery from footer

If your working with a blank theme why don’t you just remove or comment out the wp_enqueue_script(‘jquery’); in the theme functions.php? Otherwise your action hook is wrong, use, add_action(‘wp_print_scripts’,’theme_slug_dequeue_footer_jquery’); function theme_slug_dequeue_footer_jquery() { wp_dequeue_script(‘jquery’); } This will still load the build in jQuery (I think) in /wp-includes/js/jquery/jquery.js?ver=1.8.3 To remove all jQuery from the admin & the … Read more

Move jQuery to the bottom of the page whilst keeping the WordPress jQuery

You can change it by calling add_data method of $wp_scripts object. This object holds all scripts and information how to render it. To force rendering script in the footer you can do it like this: add_action( ‘wp_enqueue_scripts’, ‘wpse8170_enqueue_scripts’ ); function wpse8170_enqueue_scripts() { $GLOBALS[“wp_scripts”]->add_data( ‘jquery’, ‘group’, 1 ); } P.S.: I haven’t tested it, but suppose … Read more

Unwanted content in website title

I doubt WordPress would be putting a url like you mentioned ‘www.domain.com/…’ in title tags either way. Are you sure you’re that’s where it’s showing up? The hash in the url is likely just for slider functionality. You could try a different slider or ignore it, since it doesn’t affect anything.

Add a class to posts in increments of 2

Filter post_class, use a static internal counter in the filter callback: add_filter( ‘post_class’, ‘wpse_100804_post_class’ ); function wpse_100804_post_class( $classes ) { static $counter = 0; $counter += 1; switch ( $counter ) { case 4: $counter = 0; case 3: $classes[] = ‘extra’; } return $classes; } In your loop template call post_class() like this: while … Read more

Ajax Dynamic Archives not showing correct results

this is what i ended up with which works nicely. functions.php part <?php function scripts_enqueue() { if(is_page(‘archives’)) { wp_enqueue_script(‘ajax_dropdown’, get_stylesheet_directory_uri() . ‘/js/loadposts.js’,array(‘jquery’)); wp_localize_script( ‘ajax_dropdown’, ‘myajax’, array(‘custom_nonce’ => wp_create_nonce(‘nonce-ajax-dropdown’), ‘ajaxurl’ => admin_url( ‘admin-ajax.php’ ) ) ); } } add_action( ‘wp_enqueue_scripts’, ‘scripts_enqueue’ ); function wp_ajax_load_posts(){ if(!wp_verify_nonce( $_GET[‘_wpnonce’], ‘nonce-ajax-dropdown’)) die( ‘Go away!’ ); $args = array( ‘year’ => … Read more