Reload page with a different shortcode when a user selects from a dropdown

You can create a custom shortcode wrapper that will execute the shortcode with the desired attributes, so you would use [jobs-custom] in the page: add_shortcode(‘jobs-custom’, ‘custom_jobs_shortcode’); function custom_jobs_shortcode($atts) { if (is_user_logged_in()) { $per_page = get_user_meta(get_current_user_id(), ‘jobs-per-page’, true); } if (!isset($per_page) || !$per_page) { if (isset($_COOKIE[‘jobs-per-page’])) {$per_page = $_COOKIE[‘jobs-per-page’];} else {$per_page = 10;} } return do_shortcode(‘[jobs … Read more

List all ACF field values across every post on one page

You want to start here and here. Essentially you’re just looping through all your posts like normal and then adding some custom fields into it. Be sure to reference the Repeater Field documentation. This should work inside a loop. Notice you’ll need your post ID. <ul> <?php if( have_rows(‘YOURREPEATERFIELDNAMEHERE’, ‘POSTIDHERE’) ): while ( have_rows(‘YOURREPEATERFIELDNAMEHERE’, ‘POSTIDHERE’) … Read more

add_action in wp_head accessible from class

You’re using the static class method call when supplying a callable/callback to add_action(): add_action( ‘wp_head’, array( ‘test_class’, ‘greeting_head’ ) ); So you should make the greeting_head() a static method in your test_class class. But you’d also need to make the greeting() a static method: class test_class { public static function greeting() { echo ‘Howdy! Test … Read more

Add function to head “no product found”

It’s better to use PHP to remove things when possible, because if you just use JS, they’re still technically there on the page. What if a visitor is on a slow-loading network and the JS doesn’t kick in for a long time, so they see the filters long enough to use them? If you can … Read more

get_template_part() not working with Advanced Custom Fields plugin

as you use multiple $testimonials i suppose those are group values. then you need to use get_sub_field() in place of get_field() so it should look like $term = get_queried_object(); $testimonials = get_sub_field(‘testimonials’,$term); echo $testimonials[‘small_title’]; echo $testimonials[‘main_title’]; echo $testimonials[‘description’]; Please refer to ACF documentation when you use non classical fields. https://www.advancedcustomfields.com/resources/group/