Tagged Questions
0
votes
1answer
28 views
Delete data from custom table when deleting a post
I want to delete post id form my custom table, when deleting a post. I have tried this way, nothing happened. Please help.
add_action('delete_post', 'delete_data');
function delete_data($post_id) {
...
4
votes
1answer
108 views
How can I save an array from a random post sequence for later use?
I'm building a random workout generator on Wordpress to help with my fitness, and am stuck at saving random post arrays for later reference.
I'll explain.
The generator should work in two main ...
0
votes
1answer
361 views
All-in-One Event Calendar: Custom Query - Getting each event Instance
I am using the All-in-One Event Calendar by Timely, and I would like to display upcoming events from the events calendar in a carousel on a separate page, and I need to get the event information.
I ...
2
votes
1answer
367 views
Nested meta_query with multiple relation keys
I am curious whether Wordpress is able to run nested meta_query, with each having different relation keys? As of Wordpress 3.0, tax_query is able to perform this function; I'm wondering whether this ...
0
votes
0answers
14 views
How do I sort multiple pages? [duplicate]
Possible Duplicate:
How do I sort multiples pages?
I would like my users to be able to sort a list of posts with a drop-down. But I'm having problems because the results are on multiple ...
0
votes
1answer
131 views
WP_Query breaks pagination
I've been on this problem for a week now. I've searched through countless posts that just aren't answering the question. It seems that my wp_query breaks pagination. I've looked through a lot of the ...
0
votes
2answers
187 views
Show default content if custom WP_Query has no posts
I have a custom loop to show posts that meet a certain set of $args like this:
<?php $recent = new WP_Query( $orderargs );
while($recent->have_posts()) : ...
0
votes
1answer
143 views
Multiple keyword search
I have a custom search where I want to enter a keyword or phrase into the search box, and then by pressing enter it adds it to a 'search storage' (already coded, see below). Asume I have 3 posts, one ...
0
votes
1answer
122 views
Select posts that match multiple category names, must match all categories listed
I need to search for posts that belong to multiple categories, but they must match all categories listed, as in if I list category names 'japanese' and 'dessert' the matching posts need to be in both ...
2
votes
1answer
318 views
Limit search results to exact match
I have a problem showing results in Wordpress with WP_Query. Problem is simple but as far I'm not programer I wound it difficult.
So, I have custom field with values like 1-1-1-1 and 2-1-1-1-1 for ...
0
votes
1answer
104 views
Adding pagination to sub-wp_query within a singular post page
So my custom wordpress theme/site has a number of venues, e.g. "foo" which has a number of events and reviews.
So a venue ends up with a URL like,
http://www.example.local/places/my-place-name/
...
0
votes
0answers
89 views
Multiple WP_Query Pagination [closed]
<div id="content" class="page col-full">
<div id="main" class="col-left">
'listing',
...
1
vote
1answer
115 views
Use post object from first query in second query
I have a post ID stored in a variable from my first query and I'd like to use that to highlight the post with the same ID in my second query, but it's not working.
First loop:
<?php if ...
2
votes
1answer
315 views
Multiple Queries and Excluding Repeating Posts?
I'm trying to work out how to exclude posts used in the first four custom queries in the last typical query.. haven't been able to find anything that will explain how to do this clearly.
My First ...
-1
votes
1answer
177 views
Getting Custom Field value in WP_Query
i am trying to display first post of 3 categs on my index page. so for that i wrote a little function as follows:
function excateg($categ) {
$recent = new WP_Query("cat=$categ&showposts=1");
...
0
votes
1answer
466 views
Magazine style frontpage with multiple categories/loops and no duplicate posts
I am migrating a static magazine site to wordpress. I would like to have a frontpage displaying multiple categories with a few posts in each, e.g "politics", "environment", "health" and "technology". ...
0
votes
1answer
379 views
Pagination problem with multiple loops on the same page
I'm using 4 custom loops to display 3 posts on each one and every loop has its own pagination which works fine once the page loads up, the problem is that when I click on the 2nd page of the first ...
0
votes
1answer
451 views
Related “custom post type” using “custom taxonomy”
on my "Work" template used for the custom post type with the same name, I have the following code showing a list of titles for every "work". What I want to do is to display
just on that list the ...
1
vote
1answer
160 views
How does order=asc effect a wp_query (its acting pretty weird in a loop)
I have a wp_query for a custom post type: events. I have a seven day calendar that is showing featured events on a page. Here is the wp_query and supporting code:
https://gist.github.com/1030760
...
0
votes
1answer
441 views
How to make a query returning pages from multiple parents
I'd like to make a query that returns the children pages of various parent pages.
Unfortunately the post_parent attribute of WP_Query accepts only one value.
What do you suggest ?
0
votes
1answer
277 views
How Can I Always Display A Particular Post First Using WP_Query?
My apologies if this question has already been asked somewhere else, I searched but couldn't find anything. I am working on a tours website, there will be individual package pages that show some text, ...
4
votes
1answer
2k views
Search multiple custom fields by using meta_query
I'm trying to create a search results listing for a custom post type and the problem I'm running in to is with the way the 'meta_query' parameter is stringing the passed values together. It appears ...
0
votes
1answer
269 views
Prioritising and Ordering Posts By Category Name Using A Custom Loop
I have a custom loop pulling out videos all assigned to various categories. However there is a category called "new-video" and I need to pull out all videos using my custom loop, but I would like the ...
0
votes
1answer
32 views
Is there a (preferable built-in) way to check what custom queries are used in a theme?
I've build a theme using custom post-types with queries like
$my_custom_post_type_query = new WP_Query( array( 'my_arg' => 'value' ));
Now I'm writing a plugin where I need to do something like
...
5
votes
2answers
3k views
Getting Post Comments for post ID using WP_Query() and a Custom Loop?
(Moderator's note: The original title was "Is there a way to get post comments by post ID on a custom loop using WP-Query()?")
Hi! I'm running a custom loop using WP_Query, that only displays one ...
