Modify the plugin ‘Motors – Car Dealer, Classifieds & Listing’ and limit the number of cars shown via the shortcode
Create this file in your child theme: /wp-content/themes/YOUR-CHILD-THEME/listings/shortcodes/motors-listings-tabs.php Copy the original file from the plugin: motors-car-dealership-classified-listings/templates/shortcodes/motors-listings-tabs.php Then change this…
Create sold page for the plugin ‘Motors – Car Dealer, Classifieds & Listing’ using Divi
Add this to the functions.php file add_shortcode('sold_cars', function ($atts) { $atts = shortcode_atts([ 'posts_per_page' => 12, ], $atts); $paged = max(1, get_query_var('paged') ?: get_query_var('page')); $query = new…
Show users how much they need to spend to qualify for Klarna on a WooCommerce site
Add this to the functions.php file and then add the shortcode of [dividebyklarna] to get it to show up. function wpb_nick_klarna() { global $product; $klarnaprice = get_post_meta( get_the_ID(), ‘_regular_price’, true); $klarnasaleprice = get_post_meta( get_the_ID(),…
Show users how much they need to spend to qualify for PayPal on a WooCommerce site
Add this to the functions.php file and then add the shortcode of [dividebypaypal] to get it to show up. // function that runs when shortcode is called function wpb_nick_paypal() { global $product; $paypalprice = get_post_meta( get_the_ID(), ‘_regular_price’, true);…
Function to disable comments in WordPress
// Disable comments on all post types function df_disable_comments_post_types_support() { $post_types = get_post_types(); foreach ($post_types as $post_type) { if(post_type_supports($post_type, ‘comments’)) { remove_post_type_support($post_type, ‘comments’);…
Function to remove Divi Projects in WordPress
add_filter( ‘et_project_posttype_args’, ‘mytheme_et_project_posttype_args’, 10, 1 ); function mytheme_et_project_posttype_args( $args ) { return array_merge( $args, array( ‘public’ => false, ‘exclude_from_search’ => false, ‘publicly_queryable’ => false,…
Show remaining cost on WooCommerce site to get free shipping
Add this to the functions.php file and then add the shortcode of [shippingleft] to get it to show up. function how_much_shipping_is_left() { $min_amount = 100; //change this to your free shipping threshold $current = WC()->cart->subtotal; if ( $current <…
WooCommerce hide Klarna payment method if order total is under £35
Add this to the functions.php to hide Klarna payment method if the order total is under £35 //hide klarna if order total is under £35 add_filter( ‘woocommerce_available_payment_gateways’, ‘rudr_turn_off_cod’ ); function rudr_turn_off_cod( $available_gateways ) { if(…
Output additional image sizes on the frontend of WordPress
Use this to find all the additional image sizes your site is using /* Output all image sizes on the frontend —————————————————————————————————- */ add_action(‘init’, ‘get_all_image_sizes’); function…
Disable Divi Custom Post Type CSS file
Add this to your functions files to disable/remove the Divi CPT CSS file from being used. /* Disable Divi CPT CSS */ function disable_cptdivi() { remove_action( ‘wp_enqueue_scripts’, ‘et_divi_replace_stylesheet’, 99999998 ); } add_action(‘init’, ‘disable_cptdivi’);…
Recent Comments