New answers tagged

0

I was fumbling with this one, but then i remembered we have access to the post-id via a get-param in wp-admin add_action('admin_head', 'my_admin_head'); function my_admin_head() { if ( ! empty( $_GET['post'] ) ) { $post_id = sanitize_key( $_GET['post'] ); $template_name = get_post_meta( $post_id, '_wp_page_template', true ); echo ...


0

to grab the ACF data you will need to use $tag_tax_image = get_field('tag_taxonomy_image', $post->ID); From there I recommend doing a var_dump($tag_tax_image); to figure out how to access the data you need.


0

Marvelous, I used the idea to switch between bootstrap 3 and 4. $post_date = strtotime( get_the_date( 'Y-m-d', '', '', false ) ); $cutoff_date = strtotime( '2019-12-31' ); if (is_single() && $post_date > $cutoff_date) { echo '<bootstrap 4 code>'; } elseif (is_single() && $post_date < $cutoff_date) { echo '<bootstrap 3 code>'...


0

The solution to my problem was to use: has_term( 'the-cat-I-want-to-display', 'product_cat' ) || is_product_category( 'the-cat-I-want-to-display' ) This worked. Thanks everyone for your help!


3

Farhan, this should do it, add an else to the if statement: $args = [ 'post_type' => 'post', 'posts_per_page' => 1000 ]; $q = new WP_Query($args); if ( $q->have_posts() ) { while ( $q->have_posts() ) { $q->the_post(); ?> <p>The posts styling goes here</p> <?php } // cleanup ...


1

<?php Ninja_Forms()->display(123) ?>


Top 50 recent answers are included