0
votes
1answer
23 views

Remove duplicated values from a loop

I have a loop that outputs <option> fields for a <select> group. It contains many cities' names for many travel packs that I am publishing. The trick is that I need avoid repeated values. ...
0
votes
1answer
17 views

Loop through categories and create tab for each

I'm trying to create a page that holds all categories of my custom post type as tabs, with a tab content. I am able to display all the category names as tabs, but i need to run a query in each tab ...
0
votes
1answer
42 views

Pagination doesn't function properly for archive of a custom post type set as the front page

I created a similar question about an hour ago but since then I feel that I've changed things enough so that if someone viewed it for the first time, it'd just be a confusing mess. So I am opening up ...
1
vote
0answers
37 views

WP_Query orderby and tax_query

My goal is to have custom posts type's posts (CPT for simplicity) from a custom taxonomy (CT for simplicity) let say CT Hometown with slug Nebraska to be listed grouped by another CT, let say ...
0
votes
2answers
33 views

How to add multiple images to a custom post type single post?

I have created a custom post type and I need to add multiple images to every single post, so I can create a loop and use them in a slider. So far my search on Google etc. has turned up nothing. ...
3
votes
2answers
64 views

“pagination” (but not really) and queries using custom posts types

More of a conceptual question here, than a strict code question: Working on a site for a musician who wants to list concerts, both upcoming and past. These are custom post types that use a custom ...
2
votes
1answer
45 views

CPT posts listed by category with custom rewrite URL, please help!

Here is what I'm trying to do: I have 10 total dessert recipes (in shared dessert category) that are divided by 2 custom post types. I want to create 3 different views of these posts with the custom ...
0
votes
1answer
23 views

Sorting by meta_key different to search criteria?

I've created an admin only page simply to view more information about subscribers to my website. The subscriptions are stored as Custom Post Types. All I want to do is make a condition that looks up ...
0
votes
2answers
27 views

Variable not working in WP_Query

I have used this technique before and cannot work out why this time it is not working. 'news_category' is a custom taxonomy of my custom post type 'News'. I am getting the taxonomy of the current ...
1
vote
1answer
65 views

Display multiple custom post types and sort them chronological by one of their fields

I have four custom post types created with the custom post types ui plugin; each stands for an event type with a different set of custom fields created with the advanced custom fields plugin. My ...
0
votes
1answer
80 views

WP_query - Filter by tax_query and meta_query using multiple select

I have a Publications Post Type, a Writers Taxonomy and a Publications Custom 'Meta Box' Value; parent_id. In my archive-publictions-post.php template I am trying to filter the WP_Query Class, with ...
0
votes
0answers
23 views

Search custom post type with multiple queries

I am looking for way to search custom post type with multiple queries. I need to run single query from user search and if that isnt resulting with single post result to use another query. If first ...
0
votes
1answer
20 views

Previous/Next Link by Meta Value in CPT

I'm using the following code to paginate between custom post types and it doesn't seem to be using the meta_key or meta_value_num and I can't figure out why. The CPT is set-up to have hierarchal => ...
0
votes
0answers
15 views

How to cancel a custom post type query based on existing cache file

Is there a proper way to greatly restrict the query (or remove it altogether) for a custom post type type-single.php file? Simply stated, for reasons of speed speed speed I've cached all relevant ...
0
votes
0answers
39 views

Custom Post Type: Event - Display Upcoming Events for Next 30 Days

I need to display the upcoming events for next 30 Days and sort the same based on custom date field. Below is the code I am using right now but not got any success in hiding old Events and ...
0
votes
0answers
24 views

Integrating WP_Query with multiple Checkboxes

Ive created a CTP called volunteer_position_cpt ... I've also created two taxonomies for this CPT: volunteer_category (tags) and location_category (tags) My interface: [ ] Category 1 [ ] Category 2 ...
0
votes
2answers
113 views

Using DISTINCT in wp_query

I need to create a system where the user first selects the state, then select the city and then see the information of the stores in that city. For this, I created a cpt called store with 2 meta ...
0
votes
1answer
46 views

How can I base a query off of the current page post type AND a meta value from another custom post type

I have 2 custom post types: Communities and Testimonials. I have a drop down menu in the Testimonials CPT that calls all of the communities. The drop down is using the ID of the community. I have ...
0
votes
1answer
31 views

Querying Posts by Taxonomy From Alternate Network Site

I have 5 Network sites in my WordPress multisite setup. One of which is the "primary website", which the rest of the other network sites will be retrieving data from. I am currently using ...
0
votes
1answer
26 views

Shortcode / WP_Query in post changes context

We have a shortcode that causes WP_Query to be executed, retrieving an instance of a custom post type. In our single.php this changes the context (after the call to the_content()) from the original ...
0
votes
2answers
65 views

Retrieving 3 latest post from each of 5 different custom post types

I have 5 different custom post types. I am showing 15 latest post from them on my home page using following query: $query = new WP_Query( array ( 'posts_per_page' => 15, ...
1
vote
0answers
50 views

Configuring a meta query with multiple post types that have the same relationship on a single page

I am creating a client portal were my clients can maintain their projects and leave feedback. I have two custom post types called "Clients" and "Projects" and they each pull information from one ...
0
votes
0answers
49 views

Strange behavior with pagination on custom query

I already have a knot in my brain and searched here and on the web, but I can't find any solution. I build a Custom Post Type with some Taxonomies and create a page template to get some of the posts ...
0
votes
2answers
44 views

Query posts by a type and another type only if post is in specific category

I have a featured post type and a reviews post type. I would like to include reviews of a certain category (I use categories from the posts type) as well. How could query args be crafted? A crude ...
1
vote
0answers
157 views

Query by 2 values of a repeater ACF field

Let's say I have a custom post type called Film, with a repeater field called Showings, with fields start_datetime and discount. I need to make a query for those Films that have at least one showing ...
0
votes
2answers
68 views

Archive page - problem with pagination

I have a problem to display pagination using WP_Query. I've created a custom page, code below: <?php /* Template name: Models */ ?> <?php get_header(); ?> <?php the_post();?> ...
1
vote
2answers
50 views

Different Ways to Query Custom Post Types?

I'm using this code to use custom post types like regular post: add_action( 'pre_get_posts', 'add_my_post_types_to_query' ); function add_my_post_types_to_query( $query ) { if ( is_home() && ...
1
vote
1answer
174 views

Unable to get paginate_links working with a custom query [duplicate]

I have built a news section in my Wordpress site with the advanced custom fields and custom post type ui plugins. On the custom news overview page (not the standard wordpress posts) I wanted to limit ...
1
vote
0answers
88 views

Posts 2 Posts: Get related posts from user connected to current post? [closed]

Hopefully someone can help with this. I have a CPT called "Tours", and I'm using Posts 2 Posts to connect Posts inside that CPT to Users. Relationships being: Tour Item 1 > Tour Operator 1 Tour ...
0
votes
2answers
230 views

Using global $post; to get featured image for custom post via WP_Query

I'm using a site-wide function to add css to the <head> of the page pull in featured images of various as a responsive page background. It works great across the rest of my site but fails on a ...
0
votes
0answers
36 views

Issue with permalinks for custom post type

I have a little issue here... When i'm using default permalinks, everything works great, but when I set up %postname% permalink in settings, my template with custom post type is not loaded. ...
0
votes
1answer
189 views

Using WP meta query to show custom post types by a start and finish date

I have a custom post type called 'events', I have a page which displays events by each month. Each event has a start_date and finish_date custom field (using advanced custom fields plugin) which ...
1
vote
2answers
229 views

Display Posts of a Category in Alphabetical Order (Custom Post Type)

I have a custom post type called "link" I have a custom taxonomy for this post type called "link-category" I have a template file for this taxonomy, "taxonomy-link-category.php" I need the template ...
0
votes
0answers
21 views

Show taxonomy and custom post type in the same query

I am not sure how to raise the question, because I find all that goes in another way, I will try... I have three custom post types and these have their own taxonomies. The following is a simplified ...
0
votes
1answer
57 views

Two queries – one with checkbox ticked, one without – comparing meta_query

I am trying to do the following: Two queries 1. Get all people that have director 'yes' ticked 2. Get all people that don't have director 'yes' ticked I have the first query all set up and works ...
0
votes
2answers
28 views

Include both default and Custom Post Type in query modified inside pre_get_posts

I want to include custom post type in the author arhive page. I tried the method discussed in this post: Including post_type = 'wiki' in author archives add_action( 'pre_get_posts', ...
0
votes
1answer
225 views

WP_Query and two custom fields returns no posts

Having trouble with WP_Query returning no posts when filtering on two custom fields, although testing for each custom field individually works perfectly. After reviewing documentation for custom field ...
0
votes
1answer
89 views

Foreach loop returning more than one item when querying taxonomy

I am querying the taxonomy terms and then listing the posts that are under those terms. The taxonomy is basically a category for a custom post type, and the terms in it are the categories. I didn't ...
0
votes
3answers
510 views

Custom Query With Multiple Meta Key Value

I am new with WordPress development and I have found this query and I want pass multiple key and value in this query. My Query is: $querydetails = " SELECT wposts.* FROM $wpdb->posts ...
0
votes
0answers
9 views

Pagination on custom post type with 2 wp_queries [duplicate]

Im trying to get my pagination on a page that lists all custom post types working. I have tried both the bones theme next/prev as well as the default wordpress option, to no avail. This is the two ...
0
votes
1answer
77 views

Get custom posts with certain ids in a custom loop using a shortcode

So I'm using custom loop and shortcode to insert it in any page. Like this: function register_custom_shortcode($atts){ extract(shortcode_atts(array( 'ids' => '', // this is what I ...
0
votes
2answers
104 views

How to query for posts (in hierarchical custom post type) that have children?

I'm trying to figure out how to query for posts in my hierarchical custom post type, presumably using WP_Query that have child posts. I can get all pages that don't have children by setting ...
0
votes
1answer
57 views

Custom Taxonomy with Custom Post Type Finds No Posts

I've created a custom post type named mfg_ppn and a custom taxonomy called mfg_pp, and they are referenced as $this->cpt_promotion_newsand $this->cpt_promotionin case you were wondering about ...
0
votes
1answer
88 views

Show custom post type filtered by category

I would like to have a custom post type which contain several sliders for showing in each category page (exact category.php), one for each as planned. All sliders were assigned to related category. ...
0
votes
3answers
235 views

ACF: post query, hide duplicate values [closed]

I'm querying an ACF field, and displaying all the results on the front-end like so— PHP: <ul class="category-menu-items"> <?php // args ...
0
votes
1answer
32 views

How can I pull information from my loop and divide them seperately?

I've created a Custom Post Type that I'm trying to implement into a CSS slider. To do this I've created a custom template and added counters to get unique ID's for every new post that get's pulled. ...
0
votes
0answers
78 views

Filter plugin posts by meta value

I am a WordPress beginner, but have a few years of software development experience. I have a WordPress plugin used to display custom data via a custom post type. The index page contains something ...
1
vote
2answers
59 views

Randomize Posts. Skip the first post in ascending order

I'd like to randomize a set of posts (custom post type), but ignore the first post all together. Here's the code I thought would work: $featured_content_query = new WP_Query( array( 'post_type' ...
0
votes
1answer
107 views

Custom post type blog pagination conflict

I have a custom post type called 'emp_case-studies' and it has a page archive. Here is the code for archive-emp_case-studies.php: <?php $blog = $wp_query; $wp_query= null; $args= null; ...
0
votes
2answers
699 views

Prevent pre_get_posts filter on specific post type

I am running into one issue with pre_get_post filter. Actually I have 4 post types. Post, Pages, Events, and Venue. I created one custom field called city for event and venue post type. When ...