Tagged Questions
0
votes
2answers
48 views
Interrogate a page within a loop to check template type or custom meta data (Pages vs Posts)
I've spent a few days researching working with WP static pages - as separate from posts.
Although I've found useful guidance, I can't seem to find any good tutorials or worked examples that show me ...
0
votes
2answers
33 views
I want my post to republish again after adding a custom field
I wanted a code in Wordpress that could allow me to republish the post every time I add a new custom field.
For example, if I already have a post and wanted to add an update to it; I want it to appear ...
0
votes
1answer
9 views
Collect Data from NEXT item while in loop
I am trying to get the value of a custom field. The trick? I'm in the loop, currently printing out 2 of 5 for this example. I would like to get some info from 3 of 5 (or even 1 of 5) while printing ...
0
votes
1answer
137 views
Upcoming Event: How do I sort database by custom date field, but ignore past dates?
I am using an events plugin and struggling to get my database query to be perfect. The query is on the event-single.php template. What I need the query to do:
Query the "events" custom post type ...
0
votes
0answers
70 views
How to display custom post types by custom taxonomy in while loop?
I am using Posts 2 Posts to display a custom post type on a page.
Document status, document author and feedback due date are custom fields.
Package is a custom taxonomy.
I want to display my custom ...
0
votes
1answer
69 views
how to make nsfw post with thumbanil
iam making a comic site like 9gag
the front end upload page contains
title
upload image
tags
NSFW [checkbox]
if every thing is normal
the image become featured image of the post ,
i want the NSFW ...
0
votes
1answer
335 views
Get post-meta value of all custom-posts - lowest to highest year-count?
probably tough to describe:
I have a custom-post-type called wr_event and a custom-field for it called event_date.
I have a lot of posts and each of those posts has set an event_date. Pretty ...
0
votes
1answer
107 views
loop through custom post-type with two meta_keys
I have a custom-post-type named my_project.
This post-type has two meta-boxes:
is_featured
is_featured_position
So essentially in my backend of the post-type I can set a checkbox for is_featured ...
0
votes
1answer
200 views
Display posts where date field matches current month?
I have a loop which displays all the posts of the "events" post type on my site. Each of these posts has a custom date field "event_date", which I sort the display of the loop by.
I would like to ...
-2
votes
1answer
51 views
Outputting custom field query from a plugin to the website header
I added the code below to the plugin that I'm working on to display the values of the custom fields but it shows up but blank.
function mySEO() {
require('wp-site-gps-transport.php');
}
// Add ...
0
votes
2answers
91 views
Custom Query based on custom field of a single post
I have posts which have a custom field date in the format yyyy-mm-dd.
What Im trying to do is list all the posts for a specific year on the side of a single page based on the year in the custom field ...
0
votes
1answer
124 views
Display custom field outside the loop
Inside of my WordPress theme directory I have a standalone PHP file called image, this currently looks like this....
<?php
define('WP_USE_THEMES', false);
...
0
votes
0answers
9 views
Limit on Characters for Custom Field output in Loop [duplicate]
Possible Duplicate:
Truncating custom fields
Is there any way to limit the output of characters by a function inside the loop?
I am pulling custom fields from cpts and one of them is an ...
0
votes
1answer
112 views
How do I filter a custom post type loop by a field?
OK, very simple task, I'm just not good at PHP.
I have a page where I want to list some staff using a styled list. Here is the page all working fine, I just need to divide the results - ...
0
votes
1answer
152 views
Loop to display random posts only if a custom field matches category
Working on a website and need loop that will show posts ONLY if custom field value is equal to the current category name.
I have category 'fun' and custom field 'genre'. I would like to show on ...
0
votes
1answer
74 views
Filtering posts by WORD in custom field
I need to filter my posts in categories pages, by showing only posts that have specific WORD in custom field value. I need php code that i should add in loop for this category.
Details:
I need loop ...
0
votes
1answer
104 views
Can't query by meta_key
For some reason. I do not have the ability to query by meta_key when I run a loop.
What could cause this and what can I do to the diagnose the problem? I am using wordpress 3.4.1.
$args = array( ...
1
vote
3answers
717 views
Calling custom fields for pages (not posts)
I'm trying to place a small code in my template header.php file. I want to get a custom field value.
I'm trying to call custom fields from current page outside of loop, btw.
I have no problem doing ...
1
vote
2answers
706 views
Order posts by custom field and if custom field is empty return remaining posts
I have an archive page ordered by a numeric value in a custom field. This returns the ordered posts correctly, but does not display posts that don't have a custom field.
$paged = ...
0
votes
2answers
311 views
Duplicate posts being displayed when querying Custom Fields
I have created a small segment within WordPress that records match information for League of Legends. Using up to 30 different custom fields I can store information of 30 champions picked from 3 games ...
0
votes
3answers
94 views
Delist entries in the_loop
I am trying to add a delisting feature to my WordPress network. Posts which are delisted would not appear in post lists, but would still be visible if accessed directly.
I've written a plugin that ...
0
votes
1answer
57 views
Custom PT, Taxonomys and wordpress query
Ok so I have an issue with wordpress that has been driving me mad the last few days.
I have a custom post type called "help-line" this post type then has 13 categories and some of these categories ...
0
votes
1answer
80 views
Displaying Posts Using a Custom Query with a Custom Field and a term_id
I'd like to display a list of posts in a category of a taxonomy using a Custom Field.
Here's my code:
if($current_term->term_id=='143') {
$querystr = " SELECT wposts.*
FROM ...
0
votes
1answer
189 views
how do i remove posts from a WP_Query so the pagination is right?
I'm using a custom post type and showing 20 of them per page on the homepage. I'm using QP_Query.
One custom field for the custom post type (called mixtapes) is a checkbox called "unreleased" (set ...
0
votes
1answer
537 views
How do I list a custom field and custom taxonomies for each result in a loop?
How do I list a custom field and custom taxonomies for each result in my loop below?
<?php
$temp = $wp_query;
$wp_query= null;
$wp_query = new WP_Query();
...
1
vote
3answers
856 views
Using new WP_Query in shortcode in a custom field causes the main post content to not display
I've got a custom post type of files I'm trying to list using a new WP_Query.
It works fine when I add the shortcode within the main post content. However, when I add the shortcode to a custom field ...
0
votes
1answer
90 views
How to show content of custom fields in search results?
I was able to include the pages where there are custom fields in search results but I managed not to display the content when there is nothing in the content. Is there a way to include the content of ...
0
votes
1answer
425 views
Custom field outside the loop and inside an array
I am trying to use a custom field inside a widget so it's therefore outside the loop. Taking it a step further, the theme I have is using an array to generate listings which makes it hard for me to ...
0
votes
2answers
175 views
Efficiently sort only certain categories by custom field
I have a site with about 1,000 posts spread out over 70 or 80 categories. Some of these categories require the posts be sorted by a custom field, others not.
I've got a working solution by having ...
0
votes
2answers
269 views
How can i loop through custom post type according to custom meta field?
I have a winery website with the custom post type "wine", each wine has various custom meta fields like "vintage", "pH", "Varietal-Composition" etc...
Now, i would like to list all wines where ...
0
votes
1answer
574 views
Display metabox title for custom fields with values
I'm using multiple metabox panels in my write posts. IN my functions I'm registering multiple metaboxes:
$prefix = 'dbt_';
$meta_boxes = array();
$meta_boxes[] = array(
'id' => ...
0
votes
1answer
319 views
Retrieve IDs from custom field, count and display results differently according to count
The function below is inside a single post loop.
I have an array of IDs in a custom field. Such IDs represent related posts. I'm using Advanced Custom Fields (ACV) plugin and I manage the custom ...
0
votes
1answer
107 views
use custom field value as post category in loop
I have a page template and at the bottom, I want a loop of posts based on a custom field value - store_name
This is what I have:
<?php
global $wp_query;
$paged = (get_query_var('paged')) ...
2
votes
1answer
3k views
How set featured posts using checkbox in post edit screen?
I want to make selecting a featured post is just by checking a checkbox in edit screen AND be able to retrieve these featured articles from only specific category ?
in short what I'm looking for :
...
0
votes
1answer
198 views
Can I access a post meta field before the loop?
If I call the following function (on a page template, e.g. page-home.php) before the loop, nothing is returned. If I call it during or after the loop, the expected values are returned. Is there a way ...
0
votes
2answers
708 views
Filter or order based on custom field
I have added a custom field to some posts called 'frontpagerank'
The plan is to order the posts by this value but first I just want to filter out any that don't use a front page rank.
I have achieved ...
1
vote
1answer
1k views
How to insert content from another Custom Post type into Post?
Say I have a custom post type called "Performers". This gets populated with different bands/performers. These posts have a featured image as well as custom fields (mp3 file, facebook link, myspace ...
0
votes
2answers
288 views
Displaying page image in the footer automatically
I've got the following problem:
each page of the site has its own image which needs to be placed within the footer div for correct, static placement. However each image is different so I can't just ...