Show terms in archive page

get_terms() retrieves terms in general, it makes no connection to a current post in loop. What you need is one of template tags, which retrieve terms for the post. For example the_terms(): while (have_posts()) : the_post(); the_terms( get_the_ID(), ‘event_cat’ ); endwhile; There are quite a few functions dealing with terms, depending on what you want … Read more

Accessing the Posts page Content

So you can fetch the id using a get_option call, then access the data from there. $page_for_posts = get_option( ‘page_for_posts’ ); $page_data = get_page( $page_for_posts ) ; Then you can access the properties like this: <?= get_the_post_thumbnail($page_data->ID) ?> <h1><?= $page_data->post_title ?></h1> <?= $page_data->post_content ?>

Reset Loop get_posts();

$posts is a global var used by WordPress, change that to something unique and it’ll work as expected. Also fyi, rewind_posts(); isn’t necessary here, you haven’t run the loop yet, so there’s nothing to rewind.

Displaying information from custom field on custom post type

I think you are passing a wrong post ID value to the get_post_meta() function. Try this: $ytubeID = get_post_meta(get_the_ID(), ‘_youtubeID’, true); $vimID = get_post_meta(get_the_ID(), ‘_vimeoID’, true); Note:, as you are using a new instance of WP_Query, you don’t need wp_reset_query();, use wp_reset_postdata(); instead. Until you add the full code that you are using to store … Read more

Query Not working as expected

You aren’t preserving the paged query var in your query. You can accomplish this by making line 4: $wp_query = new WP_Query($query . “&paged=” . $original->query_vars[‘paged’]); UPDATE: After the edit on the OP, the issue was that the paging variable, paged was in the query being sent to the function. But, there was a typo … Read more

Display more than 10 posts on author.php file

when you use the loop the number of post displayed is choosen fron the option set in Settings->Reading in you backend. It affects all the standard loops, not only the author page. To change only for author page you have to use pre_get_posts hook and set the wanted number of posts using posts_per_page argument: add_action(‘pre_get_posts’,’change_numberposts_for_author’); … Read more

List terms of custom taxonomy if matches other taxonomy

Your approach isn’t bad, but instead of echoing all of these out, you should store them in an array, then use array_unique to remove duplicate entries before displaying. <?php $array_out = array(); while ($the_query->have_posts()) : $the_query->the_post(); ?> $terms = get_the_terms( $post->ID, ‘city’); foreach($terms as $term){ $term_link = get_term_link($term, ‘city’); $array_out[] = ‘<a href=”‘.$term_link.'”>’.$term->name.'</a>’; } endwhile; … Read more