wordpress post images in accordion not showing up in some of the pc
I think that the images are not showing correctly because you have javascript errors on the page, you should first solve
I think that the images are not showing correctly because you have javascript errors on the page, you should first solve
I encountered a similar issue and this is how I solved it. Note that I put in Fruits as the taxonomy name based on your example. It’s important that this name matches the taxonomy name exactly. Often taxonomy names are singular, i.e. fruit function wp4382_filter_terms_order( $orderby, $query_vars, $taxonomies ) { if ( ! empty( $query_vars[‘object_ids’] … Read more
First you have to create secondary loop and use it. // $categories = wp_get_post_categories($post->ID); $categories = get_the_category($post->ID); foreach ( $categories as $category ) { echo $category->name; } Description get_the_category( $post->ID ); This tag may be used outside The Loop by passing a post id as the parameter. Note: This function only returns results from the … Read more
The WP_Comment_Query class supports ordering by: ‘comment_agent’, ‘comment_approved’, ‘comment_author’, ‘comment_author_email’, ‘comment_author_IP’, ‘comment_author_url’, ‘comment_content’, ‘comment_date’, ‘comment_date_gmt’, ‘comment_ID’, ‘comment_karma’, ‘comment_parent’, ‘comment_post_ID’, ‘comment_type’, ‘user_id’, ‘comment__in’, ‘meta_value’, ‘meta_value_num’, There’s a way to adjust it via filters so we can support ordering by the post title: $args = [ ‘status’ => ‘approve’, ‘post_status’ => ‘publish’, ‘post_type’ => ‘post’, ‘orderby’ => … Read more
If I understand the question, you’re looking for the SQL for the equivalent of $args = array ( ‘post_type’ => ‘popular_music’, ‘post_status’ => ‘publish’, ‘tax_query’ => array ( array ( ‘taxonomy’ => ‘category’, ‘operator’ => ‘NOT EXISTS’, ), ), ‘posts_per_page’ => -1, ‘orderby’ => ‘ID’, ‘order’ => ‘DESC’, ) ; $query = new WP_Query ($args) … Read more
Try using post_date: ‘orderby’ => ‘post_date’ check if you have sticky posts too, sticky posts will always on top of your result.
You are most likely using browser caching ? Therefore new visitors would see the newly published post just fine, but because you’ve previously visited the page its cached and therefore your browser cache hasnt expired. Generally its good practice to clear all caches upon publishing posts/pages and/or activating or deactivating a plugin. You can also … Read more
If we want to exclude the featured post image then here’s the one-liner updated: $ids = join( ‘,’, wp_filter_object_list( get_attached_media(‘image’ ), [ ‘ID’ => get_post_thumbnail_id() ], ‘NOT’, ‘ID’ ) ); here it’s expanded: $ids = join( ‘,’, // join array by comma wp_filter_object_list( get_attached_media(‘image’ ), // fetch attached images [ ‘ID’ => get_post_thumbnail_id() ], // … Read more
You can try like this: if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it. the_post_thumbnail( ‘full’, array( ‘class’ => ‘responsive-class’ ) ); // show featured image }
I had the same problem of needing to only apply $post_clauses to specific loops/queries and was able to use THIS solution provided by Stephen Harris: You can access query variables (including custom ones) via the WP_Query::get() method. For example: $my_query = new WP_Query( array( … ‘wpse105219_custom_var’ => ‘foobar’, … ) ); To ‘catch’ this at … Read more