getting custom post by tag

Try this code as by using tag_slug__in, not tag. $search_videos = array( ‘posts_per_page’ => -1, ‘post_type’ => ‘videos’, ‘tag_slug__in’ => $search_query ); $new_query = new WP_Query( $search_videos ); $search_videos_posts = $new_query->posts;

post and page and custom post type

There are many ways of achieving the same or similar outcomes when it comes to WordPress. It is difficult to answer Question:3 without a full overview or gaining more detail into your project. You are correct in your assumptions for question 1 and 2 for the purposes of this context. I’m sure there are many … Read more

how to put post customized in page

Create a custom template page for the archive food-archive.php and then query the posts Learn about custom templates: https://developer.wordpress.org/themes/template-files-section/page-template-files/ Learn about posts queries: https://developer.wordpress.org/reference/functions/query_posts/ the query should pull through permalink, post thumbnail, title, and details (which would possibly your excerpt as per your image)

Post data across WordPress sites

You can use url parameters (read more here http://php.net/manual/en/reserved.variables.get.php) but of course you need to create a small function in jQuery / javascript to retrieves those. For instance, placing a link like https://www.websiteb.com?country=yourcountry in your Website A and using a get_url_param(country) jQuery function in your Website B, you could pass the value to the AJAX … Read more

Sorting post by custom field and category

If you are on a category page (that is at URL like https://example.com/cateogry/test/ and want to filter your query by “test” category) then you can modify your code to this global $wp_query; $query = new WP_Query( array( ‘meta_key’ => ‘date_event’, ‘orderby’ => ‘meta_value_num’, ‘order’ => ‘DESC’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘advert_category’, ‘field’ => … Read more

Sync All Post Type Tag

If you want to auto-create the same term in another taxonomy, the following code should do it: You’ll add the code to the theme functions file (i.e. functions.php), and make sure to change the $taxonomies which is the list of the applicable taxonomy slugs — the taxonomies that you wish to “sync”. Both the $taxonomies … Read more