Tagged Questions
0
votes
1answer
25 views
Control content before and after custom post type loop
I am trying to create a left nav menu that contains a couple of different taxonomy lists of a custom post type. For example, the left menu might look like this...
<h2>New Stuff</h2>
...
0
votes
0answers
23 views
Combining Custom Tax Conditionals and Custom Querys?
The following has a custom post type of features, within that a custom tax called feature-type with three categories, template-1, template-2 and template-3.
Each custom post feature needs to select ...
1
vote
2answers
67 views
Query for posts in 2 taxonomies
I am currently using the following code to display a list with links to posts in a specific CPT and taxonomy:
<?php
$custom_terms = get_terms('videoscategory');
foreach(array($custom_terms as ...
0
votes
1answer
74 views
Display Posts Query with IF function
I'm writing a template to display my custom posts types in a list. But I only want to have the post show if it has a value for one of my custom fields. I'll explain: My custom post type is "Faculty ...
0
votes
1answer
23 views
Custom query shows custom post types in trash
I have a custom wordpress query like so:
$query = new WP_Query(array('post_status' => 'future || publish', 'post_type' => 'kalender', 'order' => 'ASC'));
But the problem is that the items ...
1
vote
1answer
25 views
child of post type (custom)
I registered a custom post type (foo) with register_post_type, setting 'hierarchical' => true,so now when I want to use it I have post_type=foo.
How can I query child of foo? any ideas?
thanks!
0
votes
1answer
111 views
Query Multiple Custom Post Types & Exclude a Taxonomy Term
I'm querying multiple custom posts types and I'd like to filter certain posts that are tagged with a specific taxonomy term.
The taxonomy is "content" and the term is "indy"
I'm using the the code ...
0
votes
1answer
51 views
What's the best way to show custom post types? With page template it's not perfect!
I created a custom post type with name career. I would like to know what's the best way to list the posts. I created a page template with a query inside, but the pager is invisible. I don't know ...
0
votes
1answer
22 views
Custom Post type showing up in loop, regular posts are not showing up
Every one knows the basic WordPress loop, every one knows that if you want just posts in a loop you put query_posts("post_type=post"); BEFORE the loop. which I have done.
The problem is I have a ...
2
votes
1answer
122 views
order by meta_value serialized array
Hi I'm trying to pull posts using the wp query. Just one problem--I am trying to sort the posts alphabetically by a certain meta_value. Thing is that this meta_value is a serialized array. Is there an ...
1
vote
1answer
44 views
How do I query a custom post type with a custom taxonomy?
For some reason I'm finding it a struggle to grab any posts using a custom taxonomy... can anyone unravel my stupidity?
$args = array(
'post_type' => 'adverts',
'advert_tag' => ...
0
votes
1answer
33 views
How to apply order on custom taxonomy and custom meta key on custom post type
Here is the code in am using
$arg= array(
'post_type' => 'vr_listing',
'tax_query' => array(
array(
'taxonomy' => 'vr_listing_status',
'field' => ...
0
votes
1answer
222 views
Combine query_posts() and get_posts() into single query
I am creating a site which uses normal posts for a blog and the a custom post type for events(generated by the events plugin). I have successfuly used different queries to grab both but I want to ...
0
votes
1answer
198 views
Custom post type, custom taxonomy, query posts only from taxonomy (children of)
I have a custom post type (portfolio-type) with a custom hierarchical taxonomy (portfolio-category)
Now I would like to query only posts from potrfolio-type, so i do:
$paged = 1;
if ( ...
0
votes
2answers
67 views
Limit the post for differents custom post type in the same wp_query
I have three custom post type:
books
magazine
videos
Now i want to limit the number of post for custom post type, for example:
books => 3 post
magazine => 2 post
videos => 1 post
I used a ...
0
votes
1answer
22 views
Assign a tag to custom post type using a query
I have a custom post type courses with a custom field level. I want to run a query (mysql or WP query) that runs through every course (post) and if the level is greater than 3, append a tag called ...
1
vote
2answers
173 views
Page template with different page and post content
I am using a wordpress theme which has a page template named roomtypes. I am not a php pro but as far as I understand this template gets the posts. When I add a Room type, it is created as a post with ...
3
votes
1answer
65 views
Using Offset in Custom Post Type Query
I'm using the following query for a custom post type:
<?php
$posts = get_posts(array(
'numberposts' => -1,
'offset' => 20,
...
1
vote
1answer
85 views
How to use custom taxonomies to reference complex relationships?
I'm working on a site that will in part house information on products that many people have worked on in different roles. I'd like for people, the projects they've worked on, and their roles in the ...
0
votes
2answers
37 views
send user to first page of results when reposting to page?
I have a custom template with a drop-down that filters posts by category. I do it by making the form post to the page itself and then catching the argument and using it in a query (see code below).
...
0
votes
1answer
83 views
Display custom posts randomly in custom taxonomy archive
I'm trying to get a random output in the taxonomy archive for my custom taxonomy "areas"
I have the taxonomy-areas.php in which I have a standard loop. This one displays the posts from 3 ...
1
vote
1answer
145 views
Listing all term items alphabetically / sorting loop
I have my own custom post type and it has its own taxonomy and terms.
Whenever user visits http://example.com/mytaxonomy/myterm I want the page to display all items within this term alphabetically.
...
-1
votes
1answer
179 views
How to exclude certain portfolios from a loop
I am new to the site and have racking my brain on a Wordpress issue for days. Hope you the intelligent people here can help me figure this out.
I have a page on my website that displays all my ...
0
votes
1answer
109 views
Query Custom Post Type based on text input
I want to query the custom post type by the three fields below. The two select fields and the one text field. The text field is the one that is not working currently.
What is wrong? How can I fix ...
2
votes
1answer
127 views
reference the current category being used in the category.php page
I have this code in my category.php file
<?php query_posts( array('post_type'=>'featured' ));
$featured = new WP_Query( array('posts_per_page'=>1, 'tax_query'=> ...
0
votes
1answer
54 views
Getting all ID's matching a title in a custom post type
I am trying to pull out all post ID's that have the same post title. This is in a custom post type called 'course-manager'. Here is what I have so far:
$pages = array();
$args1 = array(
...
1
vote
1answer
725 views
Loading post content in FancyBox
I got a tricky question. I have created a custom post type whose posts I would like to display in a scrolling carousel. The carousel will only display the title, the excerpt and a "read more" button. ...
1
vote
1answer
170 views
Order query using custom meta data
I have created a custom post type called Events with the name of events
function add_events_post_type() {
register_post_type("events", array(
"label" => __("Events"),
...
1
vote
1answer
110 views
Query Custom posts of same taxonomy as the post itself
I have 2 custom post types: "Services" and "Works" and they both have a same taxonomy 'Genre'. Now the taxonomy 'Genre' has as term called 'novice'. 5 Recent posts under "Works" which has the term ...
1
vote
1answer
336 views
Sorting multiple custom post types without a meta key/value pair by sort order
At this current moment. is it possible to sort multiple custom post/page types without a meta key/value?
I'm looking to just sort the posts by page attribute order:
What have i done so far? I've ...
0
votes
1answer
471 views
How to make WP_Query not to show irrelevant posts?
I'm using the following WP_Query arguments array:
$args = array( 'post_type' => POST_TYPE,
'tax_query' => array(
'taxonomy' => ...
0
votes
1answer
571 views
Multiple post type queries (with specific arguments for each)
So i know how to combine post types into 1 loop and out put the loop. Below is what i have:
<?php
$args = array(
'post_type' => array('post','movie','actor'),
...
0
votes
1answer
170 views
why is the current page title being output?
this is in my sidebar.php file, which is pulled in in the header.php file (is this bad practice?). anyways, the last item in the list is the current page title, despite my query_posts with an args of ...
1
vote
4answers
532 views
Unable to display multiple post types in same query (WPML WP_Query)
I'm sure there's some very easy explaination for this, but I'm stuck. I am just trying to put a nice, simple recent posts element on the front-page of a site and for some reason when I try to use:
...
1
vote
1answer
120 views
Get latest 3 posts from multiple CPT in one query
I'm looking to create a site wide feed on my site and have multiple custom post types. I'd like to display say 3 posts from at least 3 different post types. I can get the latest 10 posts across each ...
1
vote
2answers
414 views
Using Query Posts With Multiple Post Types And A Taxonomy
I am developing a site that has two different custom post types; one of them is called Articles and one is called Sketchpad. Sketchpad is user submitted content that is assigned a custom taxonomy term ...
0
votes
2answers
285 views
Getting custom post type info using get_adjacent_post
This is an example of how I'm grabbing images from my custom post type now, using query_posts();
// query_posts stuff made up here.
$my_array = get_custom_field('image:to_array', 'to_image_array');
...
2
votes
0answers
791 views
query_posts with a custom post type, a meta_query and sorting by post date?
I've searched the archives and found questions similar to what I need, but haven't found exactly what I want.
I've got a bunch of products that are sorted by a meta_key of country, and I'd like to be ...
1
vote
1answer
841 views
pagination not working for category.php (custom post types in categories)
it works everywhere on my site but it isnt working in category.php. When i click page to it goes to... domain.com/category/cat-slug/page/2
by the way this is showing custom post types within certain ...
1
vote
2answers
2k views
Return all custom meta data for one custom post type
I've set up a custom post type which has three custom meta fields: name, latitude, longitude. Each post already shows the name on an integrated map based on it's latitude and longitude.
I now would ...
0
votes
1answer
128 views
How to grab data (titles, thumbnails and custom fields) from multiple posts to populate a new array efficiently?
I need to know the most efficient method to grab 3 pieces of data from from multiple posts:
Post title
Thumbnail
Custom Field
I am attempting to build a Google map of posts using data stored in WP ...
1
vote
1answer
139 views
get custom post type
I am using this code to get custom posts in rows.
<?php query_posts('posts_per_page=72&cat=' . $cat . '&order=ASC');
$columns = 5;
$increment = 0;
?>
<table class="cat">
...
1
vote
1answer
180 views
Custom post types instead of regular post's categories in a page template
So I got this template which originally queried regular WP posts by their categories so that the page would show a category name for "category 1" as a headline and then posts from that category below ...
0
votes
1answer
183 views
Count custom post type based on two meta data
I am trying to count my custom post type called 'appointments' that match two meta data values .
The meta data keys are 'location' and 'timestamp'
So in english my query is:
How many appointments ...
0
votes
1answer
669 views
Custom Post Type Query W/Category Dropdown
I'm having a bit of trouble getting a custom post type query working coming from two drop downs. Let me show you what I'm using:
The Form:
<?php require($_SERVER['DOCUMENT_ROOT'] . ...
-1
votes
2answers
340 views
wp_query showing 2 loops over each other [closed]
http://sandbox.thekrazycouponlady.com/style/
See page, getting 2 loops over each other.
If I use this query, I only get one article and I need ten, paginated:
$query = new WP_Query( ...
0
votes
2answers
299 views
Query all posts under one taxonomy? Why is my code not working?
I'm trying to show all the posts associated with a Taxonomy (not a term) but it seems to not work.
<?php
$args = array(
'post_type' => 'projects',
'tax_query' => array(
...
0
votes
1answer
498 views
Change or update WordPress loop based on dropdown selection
I have a Contact Us page which is showing 9 locations on the sidebar by querying the custom post type "Distributors." I want the user to be able to use a drop down that is populated by the taxonomy ...
0
votes
2answers
785 views
Order by & include array by specific post ids
I have the following:
<?php $num_cols = 2; // set the number of columns here
$args = array(
'post_type' => 'testimonials',
...
0
votes
1answer
490 views
Get the ID of the latest post
Been all over looking for the best way to do this.
I want to get the ID of the latest post of a certain post_type.
How can I do this in the cheapest way possible (by cheapest I mean using the least ...