Exclude product attributes from taxonomy terms loop
Product attribute taxonomies are prefixed with pa_, so you can check the taxonomy name for that prefix and skip it if it exists: if ( substr( $taxonomy->name, 0, 3 ) === ‘pa_’ ) { continue; }
Product attribute taxonomies are prefixed with pa_, so you can check the taxonomy name for that prefix and skip it if it exists: if ( substr( $taxonomy->name, 0, 3 ) === ‘pa_’ ) { continue; }
For any poor soul out there that stumbles on the same, niche problem, the answer was frustratingly simple. Instead of trying to reinvent the wheel and build my own query, I should’ve been using the tribe_get_events function that I’m sure the Modern Tribe devs already worked hard to write. Anyway, here’s the final solution for … Read more
Try to get category info using $category = get_queried_object(); $cpt_cat = $category->term_id; $args = array( ‘post_type’ => ‘product’, ‘posts_per_page’ => 10, ‘tax_query’ => array( array( ‘taxonomy’ => ‘product_cat’, ‘field’ => ‘term_id’, ‘terms’ => $cpt_cat, ), ), ); // Custom query. $query = new WP_Query( $args ); if ( $query->have_posts() ) { global $wpdb; /* Start … Read more
Because they’re 2 different requests, and the post doesn’t carry over to the AJAX request from the initial load. Nothing is remembered between page loads, and once the page is generated, nothing persists on the server. It’s a clean slate every time, so why would it remember the post variable? When you request the page, … Read more
I just checked what the function you called does and it just retrieves the _wp_page_template value from the wp_postmeta table of WordPress. So probably the structure of your theme is not right, some rewrites are active, or something else (e.g. plug-in) altered this database table. You could check that the theme root directory is indeed … Read more
The child theme functions.php is actually loaded first (this is intentional and desired behaviour.) So despite the function_exists check in your child theme, it will achieve nothing, as it seems the parent theme does not have this wrapper and is loaded second, so a fatal error occurs. There is no easy way to override a … Read more
So I think that now you just have to add the proper css. On both elements (price and button) place: display: inline-block; You can also try: float: left;
I thought regex search may become critical so html dom parser may help. See the code below (if it helps): <?php $post_content = get_the_content(); $dom = new DomDocument(); $dom->loadHTML($post_content); foreach ($dom->getElementsByTagName(‘a’) as $item) { echo “<a href=”https://wordpress.stackexchange.com/questions/315648/.$item->getAttribute(“href’).” target=”_blank” rel=””. $item->getAttribute(“rel’) .”‘>”. $item->getAttribute(‘title’) .”</a><br />”; } ?>
What you’ve done with the variable is correct (defining it before starting the next loop), but you’re not outputting it correctly: <p>current post = <?php $current_page; ?></p> If you want to output $current_page to the screen, you need to echo it: <p>current post = <?php echo $current_page; ?></p>
As @Jacob said : To retrieve your option data : $your_data = get_option(‘option_tree’); To save your new data to the option : $new_data = array(…); update_option(‘option_tree’, $new_data);