Tagged Questions
0
votes
1answer
41 views
How to display only one category in a custom post type?
I have a custom post type called 'portcat' and I want to display the results of only one portcat category ('games' - which has an ID of '3') on my page. The below code displays all of the categories ...
0
votes
0answers
38 views
How to exclude 2 Portfolio Categories from page?
I want to exclude 2 Portfolio categories (IDs 4 & 23) from a page using the code below but it still displays all categories. Similar code works for 'Posts' but not for 'Port' - can anyone see what ...
0
votes
1answer
69 views
Specific Loop For 2 <div> Within Each <li>
I need to create a loop that can logically be described as the following for a carousel:
Requirements:
3 Loops
2 Posts Per Loop
No Duplicates
Order by Post Date
Visual:
< Start Loop #1 >
...
1
vote
3answers
221 views
Delete post revisions on post publish
Is it possible to delete post/page revisions from the database when a post/page is published?
11/05/12 Answer: See the plugin below by bueltge
I want to do this on a site with 5,000 posts and ...
1
vote
0answers
53 views
register_taxonomy() take much queries
Sorry for my poor English, I'm russian.
I have a problem by adding a lot of taxonomies.
When I added about 80 taxonomies, I get the following results(without caching):
before: 44 queries 0.352 ...
1
vote
1answer
236 views
mysql query from wordpress page using custom table
I want to a mysql query that matches a page title. Not sure of a better way to accomplish this task, but I am stuck.
This is my basic test code.
<?php
$page_title = wp_title('');
echo ...
0
votes
1answer
143 views
Adjust the order for returned posts
I have written a neat responsive slider for my Wordpress featured articles (feel free to use it):
<?php
$responsive = 'on' != get_option('henrik_responsive_layout') ? false : true;
...
1
vote
1answer
60 views
Most liked page not displaying posts
I was looking for a post rating system for a while, then I stumbled across a great tutorial:
http://wp.tutsplus.com/tutorials/how-to-create-a-simple-post-rating-system-with-wordpress-and-jquery/
I ...
0
votes
1answer
62 views
How can I add more code to this?
<?php $my_query = new WP_Query( "cat=11&posts_per_page=1" );
if ( $my_query->have_posts() ) {
while ( $my_query->have_posts() ) {
$my_query->the_post();
...
3
votes
4answers
728 views
the_date() not working
I am using wordpress 3.2 and I did a query post like this:
<?php query_posts("posts_per_page=1post=type&page=post_parent=10");?>
Then I try to echo out the date of this post I queried ...
1
vote
2answers
151 views
Wordpress - query 5 posts with a specific post in top
Many searches and tests but in vain, I need an expert to rescue me.
I need a custom post query in worpdress, which returns only 5 posts starting from a specific post. In other terms, there is a div ...
0
votes
2answers
1k views
How to order posts by modified date without using 'query_posts'?
I have an example basic wordpress theme template here for you. First, please take a quick look at it to get an idea.
<?php
get_header(); ?>
<div id="primary">
<div ...
0
votes
1answer
804 views
Change Query Arguments (filter) with jQuery/Ajax or PHP?
I have a pretty complex wordpress-site for travelling. There's an "archive-hotels.php", a template for the custom-post-type "Hotels". Inside the CPT is a taxonomy called "City", so we can do this: ...
2
votes
1answer
991 views
Using WP_Query - how to display something IF there are no results
I've used WP_Query to query and display events. In some cases, though, there are no events to be displayed and I'd like to display a friendly message when that happens instead of displaying nothing - ...
0
votes
1answer
251 views
working with term_relationships table
I have this little code to insert posts via custom form:
$post = array(
'post_author' => 1,
'post_title' => 'my title,
'post_content' => 'my content',
'post_category' ...
0
votes
2answers
312 views
Display latest post from Wordpress Featured Category that is also in X,Y,or Z categories
I want to display the latest post from a "featured" category (id=1) that may also be in either X category, Y category, or Z category (id=2,3,4 respectively). Note, there are other posts in categories ...
0
votes
1answer
101 views
Code in custom widget queries all posts, when it should only query the current post
I have a query in a custom widget (my first one!) which, if it's of custom post type book, retrieves the post ID. This then gets used in a WP_QUERY to retrieve data about the page.
This works ...
1
vote
1answer
1k views
Wordpress 3.2 query_posts and pagination, permalinks issue
My question is not new but it just does not work with all found solutions in my case.
I am trying to display recent posts on single post using custom query_posts loop. The permalinks structure must ...
0
votes
1answer
115 views
Query pulling a single post per month
I am trying to only show a single post per month on a query.
I can set the date as a variable and use something like the php array_unique function to check the dates and only echo out unique ones, ...
0
votes
1answer
581 views
Wordpress Custom Query: Combining Two Functions
I'm a bit new to php and am having some trouble combining the functionality of two custom queries in Wordpress in order to (1) get pagination to work properly, and (2) sort my posts according to a ...
1
vote
3answers
700 views
only show container with next/prev links if they exist?
hey guys,
i know there is something like
if ( function_exists('')
is it possible to use that with next_posts_link() and previous_posts_link().
The reason I'm asking that is that I have something ...
-1
votes
1answer
906 views
WP insert post PHP function dynamically generated Custom Fields
Further to my previous question WP insert post PHP function and Custom Fields
We have a working insert post function that can also send over custom fields without yet knowing the ID. Please see the ...
1
vote
4answers
1k views
How to tell if $query_var isset?
I tired to use isset($queryvar) but that didnt work, so I implemented my own function qv_isset, but it runs into a problem when $ch is set to 0.
$cls = get_query_var('cls');
$ch = ...
2
votes
2answers
1k views
Alter query on edit.php
What's the best way to alter the query being run on the Posts Edit screen (edit.php)?
The current method I'm using is by passing an argument to the global $wp_query like so:
$wp_query->query( ...
1
vote
1answer
188 views
WP database error for comments_popup_link()
I'm using the comments_popup_link() function to show the number of comments for each post in a loop.
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php if ( ...
0
votes
1answer
425 views
SQL error with custom query
I'm trying to create a custom post query for sorting posts that have been voted "thumbs up".
I'm joining my custom "wp_post_votes" table (which stores the number of votes each post received) with ...