Add Modern Tribe Event Categories as CSS classes in Event Posts
…in. add_filter( ‘body_class’, ‘cp_event_taxonomy_in_body_class’ ); // Ref – https://theeventscalendar.com/support/forums/topic/add-category-name-as-body_class/ // Add event categories terms to body class of event posts function cp_event_taxonomy_in_body_class( $classes ){ global $wp_query; $event_id = $wp_query->get_queried_object_id(); if…
Read MoreLimit the Words in WooCommerce Product Short Description
…any length to suit teasers, sliders etc and leave other areas where we want the full short description. https://gist.github.com/neilgee/c0834345db048429e3efb8ff47e3478d#file-get-shorty-php In the code snippet above we are using a conditional to…
Read MoreOutput Beaver Builder CPT Posts in a Module that belong to a Custom Taxonomy
…display from one taxonomy – this can be achieved in code using the fl_builder_loop_query_args filter. https://gist.github.com/neilgee/5b1584707cff899679235d62d4488c39 In the above code snippet – you need to ensure the BB Module has…
Read MoreOutput WordPress Custom Query Posts Loop in Bootstrap Modals
…then a counter is set $i which increments at the end of the while loop by an increment of 1, then comes the Bootstrap Modal markup, which has the trigger…
Read MoreAdd WooCommerce Product Category Dropdown to Shop & Archive Pages
…main shop area just below the headline, in essence you create a new widget and position it below the WooCommerce page title. https://gist.github.com/neilgee/7a4dc9590bce058285b7f7c2b6e0e9d4 So in the above code which goes…
Read MoreUsing MySQL Tuner with MariaDB on Ubuntu 22.04
…mysqltuner.pl Run the tool: ./mysqltuner.pl This is the type of output you will get: ——– MyISAM Metrics —————————————————————————- [–] No MyISAM table(s) detected …. ——– InnoDB Metrics —————————————————————————- [–] InnoDB…
Read MoreOutput The Featured Image in a Loop as a Linked Media Image
Instead of linking a featured image to a post permalink in a loop – here is how you can link to its original image of itself. https://gist.github.com/neilgee/b5df702da5ef092b4cd48d57dec32768 So above, the…
Read MoreAdd Link to the Count in WooCommerce Product Category Menu
…count value of the products that belong to the particular term/product category, from line 105 – the link will go to the relevant archive page for that product category. https://gist.github.com/neilgee/480cd8b274e2995631216a21175554e9…
Read MoreOutput a Custom Taxonomy Archive by using Loop in WordPress
…a foreach loop. https://gist.github.com/neilgee/b60b7407c33307ccc539108e2cbc2a5a In the above, a custom taxonomy named custom_taxonomy_name is assigned to the variable array $terms and then used in a foreach loop to output as a…
Read MoreSet up WP Fastest Cache with Optimus Prime in Local Mode
…your server then run the command from the server or better yet set up a cron job. Running Optimus Prime in local mode with WP Fastest Cache /home/mysite/ocp/ocp -l /home/mysite/public_html/wp-content/cache/all…
Read More