How to display data in archive page?

You can use the_terms function in WP to display your term values in your archive page. Usage the_terms( $id, $taxonomy, $before, $sep, $after ); Parameters $id (int|req) -> Post ID. Default: None $taxonomy (str|req) -> Taxonomy name. Default: None $before (str|opt) -> Text to display before tags are displayed. Default: Empty string $sep (str|opt) -> … Read more

I used the Tax-meta-class by bainternet but i still can’t get it to display any of the results.

There’s a slight catch to using bainternet’s Tax Meta Class: the way you save and retrieve data changes depending on your WordPress version. If you are using the latest version of WordPress then use get_term_meta instead of get_tax_meta. https://github.com/bainternet/Tax-Meta-Class/issues/115#issuecomment-170365995 I believe the exact version is WordPress 4.4. If your WP version is before 4.4, use … Read more

Get posts by name and taxonomy term

Note that if you have the post slug, you don’t need the additional taxonomy query to find that post, so it makes sense to drop the expensive taxonomy query in core in that case. Otherwise you could try instead the post_name__in parameter: [ ‘post_name__in’ => [ ‘<postslug>’ ], ‘tax_query’ => [ [ ‘taxonomy’ => ‘<taxonomy>’, … Read more

get_posts that match a user-specified value on a page

Using a variable will make your code a little less repetitive: $case_history_code = get_field( ‘case-history-code’ ); if ( $case_history_code ) { // make the code lowercase $case_history_code_lower = strtolower( $case_history_code ); // use the lowercase inside of `get_posts` $myposts = get_posts( ‘numberposts=3&offset=0&category_name=” . $case_history_code_lower ); foreach ($myposts as $post) : setup_postdata($post); ?> <a href=”https://wordpress.stackexchange.com/questions/220489/<?php the_permalink(); … Read more

Create a hierarchical taxonomy list in WordPress

You can use wp_list_categories() and pass in your custom taxonomy as an argument like so: $args = array( ‘taxonomy’ => ‘locations’, ‘orderby’ => ‘name’, ‘hide_empty’ => false, ‘show_count’ => false, ‘pad_counts’ => false, ‘hierarchical’ => true, ‘title_li’ => ” ); ?> <ul> <?php wp_list_categories( $args ); ?> </ul> https://developer.wordpress.org/reference/functions/wp_list_categories/

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)