how to add 4 post in one carousel slide
how to add 4 post in one carousel slide
how to add 4 post in one carousel slide
I can`t say this is the best solution but I know you can’t go wrong with a structure like wp_postmeta. I’ve done some custom work with GravityForms and they now use a similar structure. Instead of using postmeta there is an “entries” table. So with each form submission, there is an entry_id and multiple different … Read more
Custom Static Page to Display Blog Posts in Excerpt Non-Singular Form (is_singular not working?)
Your code uses this: number_format((float)$results[$i][‘avg_rate’], 2, ‘.’, ”) And if we look at where $i is set, we see this just before the loop: $i=0; and this: $i++; But I don’t see how this maps in any way to the current post when there’s a conditional, meaning that not everything in the results array is … Read more
In the WP Docs you can find the answer. I have not tested this snippet, but it should become something like this: $args = array( ‘post_type’ => ‘product’, ‘meta_query’ => array( ‘relation’ => ‘AND’, array( ‘key’ => ‘product-ean’, ‘value’ => 123, ‘compare’ => ‘=’, ), array( ‘key’ => ‘item-ean’, ‘value’ => 123, ‘compare’ => ‘=’, … Read more
I’ve quickly tested the below code with a small subset of sendouts ( 3 ) and changing the publishing date of my page that uses this template it works fine <?php /** * Template Name: show sendouts template * */ get_header(); global $wpdb, $post; $curDate=strtotime(date(‘Y-m-d H:i:s’)); $postDate=strtotime($post->post_date); $pageAge=($curDate-$postDate) / (60 * 60 * 24); // … Read more
number_posts is not a valid parameter in pre_get_posts, you should be using posts_per_page You should also include a check (!is_admin()) in your query to check whether you are on the front end or back end as pre_get_posts alters back end queries as well Rewrite your code to the following: add_action( ‘pre_get_posts’, function ( $query ) … Read more
Assuming your CPT is ‘videos’ you’d use: // Build the query $args = array( ‘post_type’ => ‘videos’, ‘posts_per_page’ => ‘4’, ‘cat’ => $cat_id );
There is actually a way to get posts from all multisite sub-sites. I do it with my “Multisite Media Display” plugin here https://wordpress.org/plugins/multisite-media-display/ . I use it to display all media items from my multisite to ensure that any submissions meet the site requirements. Works great. I have a similar plugin for posts, but it … Read more
I found a solution here. It works but it’s not ideal as I can’t use template-parts files etc. If anyone knows of a solution where I can use template-parts it would be much appreciated.