Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

All Questions

Filter by
Sorted by
Tagged with
-1
votes
0answers
11 views

How do you query custom post types with the same category name as the post title?

How do you query custom post types belonging to a category with the same name as the default post title of the post where the post types are displayed?
0
votes
1answer
48 views

Custom post type order by post_title

I got a custom post type called "employees" and this is the query I use with FacetWP (plugin we are using). We want to sort the employees by post_title. <?php return [ "post_type" => [ "...
0
votes
0answers
28 views

WP_Query for custom taxonomies showing posts from non-specified terms?

I have two custom taxonomies "products" & "products-info" registered for custom post type "products-posts". There are three terms (shoes, shirts, pants) in "products". Similarly, there are two ...
0
votes
1answer
14 views

How do I query with multiple custom fields orderby in same column?

I have a list of posts, one column of which I am trying to set in alphabetical order. The problem is that these posts have one of two different custom field value types shown in the same column. One ...
0
votes
1answer
24 views

How to add post type in masonry posts elementory widget

When I try to create a website using Wordpress 5.2.2. I found a widget called Masonry Posts in Elementor Panel. But when I added the widget and checked there is no option to choose the post type. We ...
0
votes
1answer
69 views

Display a post from custom post type only if all the selected taxonomies and custom field value matches the record

I have created a custom post type exam_result with academic_year as a custom taxonomy, school_class as a custom taxonomy and roll number as a custom filed using the Advance Custom Field plugin. The ...
0
votes
1answer
24 views

Returning a custom content types with meta values

I find myself facing a situation where I will have a bunch of custom post types and I want to select those with specific meta values. There is a slight wrinkle in that the value I want to select ...
0
votes
0answers
32 views

Extended Custom Post type get all posts in wp-json

Using johnbillion/extended-cpts I try to figure out how can I have all posts in wp-json response. Till now what I tried did not worked I registered the post as it follows ...
0
votes
0answers
30 views

Sort custom post type by other custom post type field. (Places by their reviews average rating)

I'm trying to sort Places (first custom post) by its Reviews (second custom post) average rating. So, basically I have two custom post types, one is Places and the other one is Reviews. Reviews have ...
0
votes
1answer
11 views

How to hide sub fields in a field group and also the entire field group if the answer selected is “no”

I have a field group (repeater field type) set up (titled "Units") with sub fields; sq footage, floor plans and availability (this is a yes/no selection). I have the availability sub field to display ...
0
votes
2answers
113 views

WP_Query with all posts in one custom post type and only posts in another custom post type with a specific category

I'm trying to do a single WP_Query to get the posts that are in 2 different custom post types but the second post type has to be from a specific taxonomy. This is what I'm currently doing: $...
0
votes
1answer
56 views

How can I group by Taxonomy on Custom Post Type while filtering out based on custom Meta

I hope I can explain this without being too confusing. I have a site where I have a custom post type that has two custom hierarchical taxonomies ( categories ) and each post also has a meta filed ...
0
votes
1answer
61 views

Custom Query: If One Post Object Field Value Is The Same As Another

Is it possible to construct If/Else queries that look to see if two (or more) Post Object fields are the same – i.e. echo X if Post Object field 1 'value' is the same as Post Object field 2, else echo ...
1
vote
1answer
2k views

How to filter custom taxonomy categories on archive?

I'm trying to modify my archive.php where I can select the categories and filter their records. I can display the categories, detect if is a taxonomy page, but by selecting them, they are not ...
1
vote
2answers
25 views

Specific query for custom post type

I am creating a directory and have a custom post type called "listings". I want to display a grid of "Most viewed" listings as well as "Highest rated" listings on my homepage and throughout the ...
3
votes
1answer
338 views

Custom Queries: Joining On Meta Values From Two Custom Post Types

Hi – I'm hoping this is the right place to be asking this question. I am in the process of moving my full football club website onto Wordpress, therefore using a single database for the information ...
0
votes
0answers
46 views

post type => 'any' not applied my custom queries

This is my PHP Code: add_action('pre_get_posts', 'orderby_custom_time', 9, 1); function orderby_custom_time( $query ) { $meta_query = array( 'relation' => 'OR', 'second_key' =&...
0
votes
1answer
194 views

Break up posts per page in two sections

I have a custom post type called 'videos' and I am using the Advanced Custom Fields plugin with a select field to use as a filter to assign where the post part will display on my page. I have two ...
0
votes
1answer
122 views

Custom Post Type not showing in main loop

I have created a custom post type 'courses' but it is not showing up when I do a var_dump of get_post_types(). here is my code. add_action( 'init', 'create_post_types' ); function create_post_types() ...
0
votes
1answer
157 views

Custom Search | Wrong output & question

UPDATE: What I want to achieve is, that a user put's in XXX into the search text input and selects wether it is buy (meta_key=kauf, meta_value=1) or rent (meta_key=miete, meta_value=1) and then pushes ...
0
votes
1answer
71 views

Custom Post Type setup

Desired behavior: Custom Post Type slug: researchers, students, collaborators URL: http://domainexample.com/people/researchers, http://domainexample.com/people/students, http://domainexample.com/...
0
votes
0answers
63 views

Linking posts together with Advanced Custom Fields “both ways”

This is a bit specific, but someone might be able to give a simple explanation if such a thing is possible, so here it is: I have two custom post types, let's say "Fruits" and "Contries". I want to ...
0
votes
1answer
626 views

Comparing timestamps in meta query doesn't work

I want to compare two timestamps in a meta_query instead of comparing two dates in the "Y-m-d" format, each of them stored separately in custom fields, but no success. The first timestamp is an event ...
0
votes
1answer
33 views

Display two post types ordered by two custom fields

I have two custom post types, created by two third party plugins, that I want to display by the main query in a common ordered list. They must be ordered by two distinct custom fields, but with the ...
0
votes
0answers
36 views

Posts show up under “published” but not “all”

I'm having a problem where a custom post type is no longer showing up under "all" within the post admin area. The posts still exist and as you can see from the picture attached, are labeled as ...
0
votes
1answer
162 views

new WP_query > displays posts only once instead of running through full array

we added a custom query to our template which works fine. So we want to display all posts out of our array. But if we have some duplicate IDs in our array, WP ignores the duplicated IDs and shows ...
1
vote
1answer
181 views

Am unable to reset a query properly

I have a custom taxonomy archive page called 'taxonomy-teacher.php' where I display teacher meta (title & description) and then I loop through all the teacher's talks (audio files), which have ...
0
votes
1answer
75 views

How do I display specific custom posts, and how do I edit a post's singular page?

Okay I'm a designer who is new to Wordpress but I'm having some trouble wrapping my head around how to properly use post types. I'm rebuilding my portfolio in a CMS. I get how to make pages easily. ...
2
votes
1answer
270 views

Calculating Bayesian average for custom post type

I have a custom post type called entries, which holds contestants for a competition. There is a 5 star rating function, the ratings are stored with the entries. So I can get the ratings_average, ...
0
votes
2answers
2k views

Pagination on search results page

I'm building currently a website on WordPress. The site has a custom post type. I have a customized search form, which selects entries from custom post type. Entries are being selected and sorted as ...
0
votes
1answer
556 views

Filter Custom post type by another Custom post type

Assume, i have two custom post types - Project and Technology. Every project has a relation to Technology (using ACF). The question is - How to filter it by Technology. I tried this approach: '...
0
votes
1answer
43 views

Querying a custom post type, but not show duplicates

I have a custom post type created called 'classes'. Within there i have a taxonomy set up as a category, so because of this there can be multiple occurrences of classes. Example: Cat 1: Class 1Class ...
1
vote
2answers
40 views

Display post content with respect to its title?

I am building a custom loop where I want to display post content only if its title matches a specific string. But I am out of luck on getting this done right. Here is my code so far. $args = array(...
0
votes
0answers
42 views

pagination for a custom query

I am trying to create a query for a custom post type that will display as a list and I need to include numerical pagination to split the list up. For some reason none of the pagination solutions I ...
0
votes
2answers
298 views

Shortcode to return single custom post based on post taxonomy

For example, if I have a custom post type that are 'Case Studies', Firstly I need to be able to query the post types for a single specific case study, but then lets say there are a few variations of ...
0
votes
1answer
70 views

Create a list of months based posts

Hey WordPress Development, Currently, I have to create a list of months based on the date query of custom posts I have for the current year. I am probably not saying this right so hopefully my format ...
1
vote
1answer
560 views

Custom post type redirected to homepage - how to debug

I have a custom post type, when I try to display the post, I get redirected to the homepage. The same happens to my blog posts I enabled Twenty Eleven theme, that works fine, so there's a problem ...
1
vote
1answer
2k views

How to modify archive query with pre_get_posts to append CPTs?

If I use pre_get_posts this way function ef_company_query($query) { if ( !is_admin() && $query->is_main_query() && $query->is_post_type_archive( 'company' ) ) { $query-&...
-2
votes
1answer
153 views

Get Posts ordered by a date custom meta field

I have created a meta field for a custom post type. This is a date field that will always be YYYY-MM-DD. There could be 100s of posts so i cant query them all and sort afterwards. I need to be able to ...
0
votes
1answer
3k views

Get posts of an specific term of a custom taxonomy

I'm new at Wordpress development and I was wondering (and trying to solve this) for a long time, so maybe you can help me. My WP use a custom post type named Products. And there is a custom taxonomy ...
0
votes
2answers
362 views

Show first posts with custom field not empty and order all by title

I have a custom post type called "products". My goal is to make my custom query that I have on homepage and also the search query show first the posts that have a custom field called "id_number" not ...
0
votes
2answers
685 views

Conditional posts in WP_query for search

I have a custom post type that im trying to limit results in search. The CPT is a deal/coupon, with a start and end date for each of the deals. What I'm trying to do is only show these posts in ...
0
votes
3answers
157 views

is_main_query() never called on WP 4.4

I'm fairly new to WP development, however as far as I can see I've followed the correct procedure in my custom archive page (below). If I remove the check for is_main_query() it wipes the menus out ...
1
vote
1answer
329 views

First custom field value (out of several) displayed twice after query

I have the following piece of code, which is based on the solution to this question: <?php $game_titles = get_terms('game'); foreach($game_titles as $game_title) { wp_reset_query()...
0
votes
2answers
2k views

Query posts between two dates (custom meta keys) CMB2

I have a custom post type (projects) which have custom cmb2 meta keys (str_dte and end_dte), so each project has a start date and end date. What I am trying to do is to get projects between two dates. ...
1
vote
0answers
89 views

Prioritize posts in query by meta keys?

I have a CPT called jobs. In my single jobs page I am counting page views with these functions: /********* Post Views counter ***********/ remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head',...
0
votes
0answers
25 views

Query Custom Post Type that doesn't have a specific Custom Taxonomy [duplicate]

I have a CPT 'catalog' and a custom taxonomy 'catalog_category' attached to it. I need to query for all 'catalog' items, that don't have any values of 'catalog_category' selected. These arguments ...
0
votes
1answer
752 views

Display year value before a set of posts

This is what I am trying to accomplish: I have a page template which displays "case studies" where "case studies" is a custom post type. the page template called: page-case-studies.php I actually ...
1
vote
2answers
2k views

Query string parameters from custom fields, inconsistent results

I've got a custom post type called course. Within a course post, I have a number of custom fields, specifically (all AFC select dropdowns): course_or_project, time_to_complete_project, ...
0
votes
1answer
1k views

Query Custom Post Types with checkboxes

I have Custom Post Type (Courses) with a field "course-location" that is a checkbox. I would like to filter the listing page with the checked items. The below code is working when I select ONE ...