Featured image size in column

In functions.php : Make sure featured images are enabled add_theme_support( ‘post-thumbnails’ ); then add add_image_size( ‘thumbnail-news’, ‘100’, ’75’, true ); And in the code above change echo get_the_post_thumbnail($post_id, ‘thumbnail’); to echo get_the_post_thumbnail($post_id, ‘thumbnail-news’);

How to display custom post type tags?

You can use get_the_term_list() to output a list of links: <?php echo get_the_term_list( get_the_ID(), ‘members_tags’, ”, ‘,’ ); ?> That will output a comma-separated list of links to attached member_tags. If you want the raw tags so you have more control over HTML, use get_the_terms() <?php $member_tags = get_the_terms( get_the_ID(), ‘members_tags’ ); ?>

WP Query ‘posts_per_page’

You add the necessary parameters to ask only for posts with the relevant clinic ID. e.g. $q = new WP_Query( [ ‘post_type’ => ‘doctors’, ‘meta_key’ => ‘clinic_id’, ‘meta_value’ => get_queried_object_id(), ] ); However, you have a fundamental mistake in how the data structure is designed. Filterable fields are supposed to be stored as terms/taxonomies, not … Read more

custom post for slider

Preblem is because inside loop you have UL echo ‘<ul>’; while ( $loop->have_posts() ) : $loop->the_post(); ?> <li data-transition=”fade” data-slotamount=”6″> <?php echo wp_get_attachment_image( get_post_thumbnail_id(), ‘full’, false, array( ‘class’ => ‘thumbnail zoom’ ) );?> <p><a href=”#.”><?php the_title();?></a></p> </li> <?php endwhile;echo ‘</ul>’; Just make one IF statment before echo-ing UL tag $loop = new WP_Query( $args ); … Read more

Loop increase number

You can add a php variable and increment it every time the while loop runs $args = array( ‘post_type’ => ‘events’, ‘order’ => ‘ASC’, ); $wp_query = new WP_Query($args); ?> <script type=”application/ld+json”> { “@context”:”http://schema.org”, “@type”:”ItemList”, “itemListElement”:[ <?php $i=0; while ( have_posts() ) : the_post(); $i++; ?> { “@type”:”ListItem”, “position”:”<?php echo $i; ?>”, “url”:”<?php the_permalink(); ?>” … Read more

How to hyperlink content from archive page with custom post-type

use the_permalink or get_the_permalink to display/retrieve the URL of a post ( a post of any type, they’re all the same internally ) e.g. the_permalink(); orx <a href=”https://wordpress.stackexchange.com/questions/283706/<?php echo esc_url( get_the_permalink( $post_id ) ); ?>”> Notice I used esc_url to escape the value for security reasons. Here are some similar functions you might find useful: … Read more

Get Post Terms of Current Post (selected taxonomy term) – How to get only the taxonomy value and not “Array ( [0] => taxonomy term )” in the frontend?

Assuming the taxonomy name is “animals” <?php //This will show all the terms in taxonomy whether they have posts or not thus the “hide_empty” $terms = get_terms( array ( ‘taxonomy’ => ‘animals’, ‘hide_empty’ => false, ‘parent’ => 0, ‘orderby’ => ‘description’, ‘order’ => ‘ASC’ )); foreach ($terms as $term) { // The $term is an … Read more