Categories
CMS Mastering Development Wordpress

get_terms based on post meta value

I’m listing events using the following arguments for my query, these load in via ajax and have a filter: $date_args = array( ‘post_type’ => ‘events’, ‘meta_key’ => ‘event_start_date’, ‘posts_per_page’ => 20, ‘orderby’ => ‘meta_value_num’, ‘order’ => ‘ASC’, ‘meta_query’=> array( array( ‘key’ => ‘event_start_date’, ‘compare’ => ‘>’, ‘value’ => date("Y-m-d"), ‘type’ => ‘DATE’ ) ), ); […]

Categories
CMS Mastering Development Wordpress

Getting IDs from Child Categories in Woocommerce

So I have a script that is/was working perfectly, but now have an issue as 2 of the categories fall under a parent category. The categories without a parent work fine, but the 2 categories that now have a parent are not working (don’t echo anything) and I am assuming because the term_id is no […]

Categories
CMS Mastering Development Wordpress

How to disable single page for specific posts?

I need to disable single pages for specific posts, but only after specific condition. My code is here: add_shortcode(‘list-posts-basic’, ‘ant_post_listing_shortcode’); function ant_post_listing_shortcode($atts) { ob_start(); $query = new WP_Query(array( ‘post_type’ => ‘uredni_deska’, ‘posts_per_page’ => 5, ‘order’ => ‘ASC’, ‘orderby’ => ‘title’, ‘paged’ => get_query_var(‘paged’) ? get_query_var(‘paged’) : 1, )); if ($query->have_posts()) { ?> <?php while ($query->have_posts()) […]

Categories
CMS Mastering Development Wordpress

Filter posts by tags in a category

I need a little help. I made a page where I listed posts in a certain category. I’d like to filter this posts by tags. My question is how to get tags for each posts and how to write a code for the filter? <?php $args = array( ‘category’ => 101, ‘post_type’ => ‘post’, ‘orderby’ […]

Categories
Mastering Development

Kibana scripted fields sort

I’ve faced the following issue: I’ve created a script field which returns String type field But when I try to make sorting on this field by the Kibana means there’s an error "Error loading data [script_exception] compile error" Then I went to the discover tab, selected this field, clicked to sort by this field: discover […]

Categories
CMS Mastering Development Wordpress

Creating custom WordPress query with multiple taxonomies

I have a custom post type of "the-talent" and 3 custom taxonomies (level, location, and specialty). I’m trying to figure out how to write a custom query for "the-talent" post type using one, two or all three of these custom taxonomies. In other words the user will select from up to 3 taxonomy Dropdowns (level, […]

Categories
CMS Mastering Development Wordpress

Display a CPT based on a metabox selection

I am trying to display multiple post based off a custom metabox selection. I am currently using CMB2 as my framework to display the CMB within the backend. The selection field which has an ID of work__assign is calling all post titles from another CPT called fleet. Below is my code for displaying the CMB2 […]

Categories
CMS Mastering Development Wordpress

Order posts alphabetically with numbers but some of the posts has numbers in the title

I have this query: $args = array( ‘post_type’ => ‘alerts’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => -1, ‘orderby’ => ‘post_title’, ‘order’ => ‘ASC’, ); $alerts_loop = new WP_Query( $args ); The problem is that the order breaks in certain point. look at the imagen any ideas why it breaks. I have used: ‘orderby’ => ‘title’, ‘suppress_filters’ […]

Categories
CMS Mastering Development Wordpress

Order posts alphabetically with numbers but some of the posts has numbers in the title

I have this query: $args = array( ‘post_type’ => ‘alerts’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => -1, ‘orderby’ => ‘post_title’, ‘order’ => ‘ASC’, ); $alerts_loop = new WP_Query( $args ); The problem is that the order breaks in certain point. look at the imagen any ideas why it breaks. I have used: ‘orderby’ => ‘title’, ‘suppress_filters’ […]

Categories
CMS Mastering Development Wordpress

Order posts alphabetically with numbers but some of the posts has numbers in the title

I have this query: $args = array( ‘post_type’ => ‘alerts’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => -1, ‘orderby’ => ‘post_title’, ‘order’ => ‘ASC’, ); $alerts_loop = new WP_Query( $args ); The problem is that the order breaks in certain point. look at the imagen any ideas why it breaks. I have used: ‘orderby’ => ‘title’, ‘suppress_filters’ […]