Author: Support Admin

Debugging WordPress With error_log()
[ad_1] By OutsourcedContent — on January 6, 2018 If Debug logging is enabled, simply use the error_log() function and it will be written to /wp-content/debug.log . Refer this article to see how it can be done: Enable Debug Logging In WordPress You can also write the error_log to a file. WP_DEBUG need not be set…

Full Width Responsive WordPress YouTube Embeds Automatically
[ad_1] 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…

Add Left And Right Swipe On Mobile For Bootstrap 4 Carousel
[ad_1] 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…

Redirect User To Post If Search Results Return One Post
[ad_1] 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…

Unhooking Actions Hooked Inside PHP Classes With remove_action
[ad_1] 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’ );…

Read Plugin Version Of Any WordPress Plugin
[ad_1] By OutsourcedContent — on April 19, 2018 Using the get_file_data() function. More efficient than using get_plugin_data() function. $plugin_data = get_file_data( WP_PLUGIN_DIR . ‘/plugin-folder-name-in-wp-content-plugins-folder/plugin-main-file.php’, array( ‘Version’ => ‘Version’ ) ); $plugin_data[‘Version’] will have the version. To read version from within the same plugin: $plugin_data = get_file_data( __FILE__, array( ‘Version’ => ‘Version’ ) ); Refer: https://wordpress.stackexchange.com/a/285644/90061…

Add Custom Post Type To Tag And Category Archive Pages
[ad_1] By OutsourcedContent — on May 20, 2018 Here is how to modify the query for default taxonomy archive pages (tag archive page or category archive page) to display custom post types. /** * Add custom post types to the default tag query * * This will make sure that the custom post types…

Limit WordPress To Perform Search Through Post Titles Only
[ad_1] On a project, sometimes you may require WordPress to perform search through post titles only and exclude post content as well as post excerpts. Although it’s not very useful to exclude post content from searches because then you will get less relevant results and also less results in quantity, but on a special project…

Remove Comment Author Link In WordPress Comment List
[ad_1] By OutsourcedContent — on July 8, 2018 Add the following code snippet to the functions.php of your theme to remove the links to the comment author website in WordPress comments list. Works when the comments list is generated with wp_list_comments(). /** * Remove comment author link in WordPress comment list * * Removes…

Remove Website Field From WordPress Comment Form
[ad_1] By OutsourcedContent — on July 8, 2018 Remove the website / URL field in WordPress comment form. /** * Remove webiste field from WordPress comment form * * Removes the website field when comments form is displayed with comment_form() * * @since 1.0 */ function velocity_remove_comment_form_website_field( $fields ) { if (…