Archive Page For Custom Taxonomy

Archive Page For Custom Taxonomy

By OutsourcedContent — on December 9, 2017 Here is the Query. Highlighted content will have to be changed for your case. <?php $my_query = new WP_Query( array( ‘post_type’ => ‘company’, ‘tax_query’ => array(   array(     ‘taxonomy’ => ‘service’,     ‘field’ => ‘slug’,     ‘terms’ => get_query_var( ‘service’ ),   ), ), ‘paged’   => get_query_var(‘paged’, 1), ) ); ?>…

Remove Version Query String From Static JS And CSS Files

Remove Version Query String From Static JS And CSS Files

A website owner should always be trying to improve the speed of their website as much as possible. When you analyze your page using any page speed analyzer such as Page Speed, YSlow or Pingdom, you are very likely to see suggestions to remove query strings from static resources, such as Stylesheets and JavaScript files….

Easy Tabbed Navigation With jQuery

Easy Tabbed Navigation With jQuery

By OutsourcedContent — on December 10, 2017 Here is the HTML Markup <h4 class=”single-company-tab-wrapper hide-if-no-js”>   <a class=”single-company-tabs” href=”#info”>Info</a>   <a class=”single-company-tabs” href=”#contact”>Contact</a> </h4>   <div id=”info” class=”tab-content”>   <p>Content of info tab</p> </div>   <div id=”contact” class=”tab-content”>   <p>Content of contact tab</p> </div> And here is the jQuery jQuery( document ).ready( function($){   $(‘.tab-content’).hide(); // Hide all tabs first …

Full Width Responsive WordPress YouTube Embeds Automatically

Full Width Responsive WordPress YouTube Embeds Automatically

By OutsourcedContent — on January 12, 2018 Add this to the functions.php /** * Add Response code to video embeds in WordPress * * @refer  http://alxmedia.se/code/2013/10/make-wordpress-default-video-embeds-responsive/ */ function abl1035_alx_embed_html( $html ) {      return ‘<div class=”video-container”>’ . $html . ‘</div>’; } add_filter( ’embed_oembed_html’, ‘abl1035_alx_embed_html’, 10, 3 ); add_filter( ‘video_embed_html’, ‘abl1035_alx_embed_html’ ); // Jetpack Add this to…

Add Left And Right Swipe On Mobile For Bootstrap 4 Carousel

Add Left And Right Swipe On Mobile For Bootstrap 4 Carousel

By OutsourcedContent — on January 13, 2018 We are talking about carousel included in Bootstrap 4, you can see how to add one here. Add this to your JS file or load it on the footer // Thanks to Maaaaark – https://github.com/maaaaark/bcSwipe/blob/master/jquery.bcSwipe.min.js !function(t){t.fn.bcSwipe=function(e){var n={threshold:50};return e&&t.extend(n,e),this.each(function(){function e(t){1==t.touches.length&&(u=t.touches[0].pageX,c=!0,this.addEventListener(“touchmove”,o,!1))}function o(e){if(c){var o=e.touches[0].pageX,i=u-o;Math.abs(i)>=n.threshold&&(h(),t(this).carousel(i>0?”next”:”prev”))}}function h(){this.removeEventListener(“touchmove”,o),u=null,c=!1}var u,c=!1;”ontouchstart”in document.documentElement&&this.addEventListener(“touchstart”,e,!1)}),this}}(jQuery);   // Swipe functions…

Redirect User To Post If Search Results Return One Post

Redirect User To Post If Search Results Return One Post

Recently on a project, my client asked me to develop a system to redirect user to post if search results returns only one post. Although it’s fairly simple system to develop but I started searching on Google if someone has already tried to develop similar function. Fortunately WordPress developer Paul Underwood has shared a WordPress…

Unhooking Actions Hooked Inside PHP Classes With remove_action

Unhooking Actions Hooked Inside PHP Classes With remove_action

By OutsourcedContent — on April 13, 2018 Here is an example. The following snippet removes the action hooked from the SumoMe plugin – https://wordpress.org/plugins/sumome/ /** * Dequeue SumoMe inline script * * @author Arun Basil Lal */ function rocket_helper_dequeue_sumo_me_js() {      global $wp_plugin_sumome;   remove_action(‘admin_footer’, array( $wp_plugin_sumome, ‘append_admin_script_code’ ) ); } add_action( ‘admin_head’, ‘rocket_helper_dequeue_sumo_me_js’ ); $wp_plugin_sumome…