0
votes
1answer
44 views

WP_Query on custom post type not displaying, multiple loops & get_template_part

I'm having problems getting my testimonials to display. On page.php I have a testimonials section. So I have a loop that grabs the content for page.php, and then a get_template_part('content', ...
0
votes
0answers
13 views

How can I put a custom field value that needs to be inside the loop, in a custom menu via functions.php?

How can I put a custom field value that needs to be inside the loop, in a custom menu via functions.php?? I'm working on a bilingual website and I'm using the Bilingual Linker plugin. I was able to ...
0
votes
1answer
27 views

do_shortcode close

I am using the jscrollpane plugin on WordPress along with the advanced custom fields plugin. The jscrollpane plugin uses the following shortcodes: [vr_jsp] [/vr_jsp] I have two different custom ...
0
votes
1answer
38 views

WP_query returns error when used for custom widget

I was working on creating my first plugin/widget that should display a really simple loop containing only a custom field (image) I've been testing the loop without any problems in my theme but when I ...
0
votes
0answers
35 views

Calling Custom Fields within a category loop?

What I'm trying to do is to display a specific category post listing within a page template, showing only each post's custom fields, which must be pulled and included within the following html. What I ...
1
vote
2answers
41 views

Get_post_meta() won't return value

Ok guys... I'm sure this is going to be a really easy answer. I'm a complete noob at this. I have a custom field that is supposed to return a link. For some reason, it just redirects me back to my ...
0
votes
0answers
28 views

Sorting Custom Posts by Custom Field

I'm currently trying to sort custom post types called 'Donors' by the 'County' they live in. I have a custom field setup called County that they can fill in on the Donor post. Is it possible to echo ...
0
votes
2answers
39 views

Search Results Page - Displaying Custom Meta Fields

For the search results page Im making a custom template. And in that custom template I want to display custom meta field values. However, when I do this: <?php if ( have_posts() ) : ?> ...
1
vote
0answers
62 views

How to show a post if was published less than two hours ago?

I want to show posts only that were posted less that 2 hours ago and have the custom field "¿directo?" with the value "Sí". These are my progresses, but they don't work: Functions.php: function ...
1
vote
1answer
81 views

List users by sum of all their posts' custom field values

So I can do this by user, individually, but I can't figure out how to put it in a foreach loop. What I want to do is output something like this: Author, Miles Where miles is the sum of every ...
0
votes
3answers
135 views

Order by a meta fiel in query loop

I would like to sort my article from a category by a number added in a meta field. Here is the first step, I get the articles to display on the page. <?php $cat = get_post_meta( get_the_ID(), ...
0
votes
1answer
34 views

If custom field is empty, use one from a previous post

Let's say you have a few custom fields (I use the advanced custom fields plugin for it). There is an extra field in posts called 'afbeelding_onder'. It is not required but on index.php within the ...
0
votes
2answers
59 views

Order by custom field attribute

I'm try to get the output of this post type to order by the staff name alphabetically and I can't seem to figure out if needs to be within the beginning array() or if I been do something within the ...
0
votes
1answer
46 views

How can I put a custom field as the link of a button shortcode?

I have been working on a custom page template, and cannot seem to figure out how to have a custom field for URL's as the link for a button in the loop. Here is my code <?php echo ...
0
votes
2answers
53 views

Get result from Custom Field in Custom Post type

If trying to filter out some return results from a custom post type that has a custom field appended to it for location. I'm not too sure where I need to apply the case statement in my query. Or if I ...
0
votes
1answer
176 views

How do I exclude posts by custom field value?

I need to exclude posts that have a custom field 'city' value of 'Melbourne'. After much searching I think the solution might consist of 2 parts. In functions.php : A function to get the post IDs ...
0
votes
0answers
21 views

Turn Custom Post Title into external link [duplicate]

I created a Custom Post Type called News, which supports Title, Editor, Thumbnail and Custom Fields. One of the Custom Fields is URL. What I need now is to turn the Title in a external link in the ...
0
votes
1answer
120 views

Displaying information from custom field on custom post type

I have videos set up as a custom post type and music, commercial, promo set up as categories within this post type: I have a function that displays a custom meta box on the videos post type pages in ...
0
votes
2answers
56 views

If i have custom post type with 5 custom fields do i have to create a new loop to reference each one?

One custom post type that i've created has 5 custom fields that display specific content for a template that displays them in different areas on the page. My question is if i would have to create ...
-1
votes
1answer
89 views

Custom field not showing

I am trying to get 3 images and their links which I have defined as custom fields. The custom field aren't displayed and when I var_dump() my get_post_meta() it returns string(0)"", what am i doing ...
0
votes
1answer
66 views

Change loop order via form or link (jquery, not URL)

I would like to change the loop order via a link or form input, but it can`t load via URL, because i need to orderby=meta-value and this cannot be done via url args (acording the codex) , only like ...
0
votes
2answers
274 views

Show image if author meta (profile fields) exists outside loop

I am trying to show the profile fields (like AIM, Jibber) outside the loop. I managed to do that with <?php global $post; $author_id=$post->post_author; ?> <?php $field='aim'; ...
0
votes
2answers
167 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
56 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
21 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
723 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
1answer
216 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
760 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
182 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
750 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
76 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
229 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
289 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
1answer
205 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
217 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
96 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
109 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
3k 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 ...
2
votes
4answers
3k 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 = ...
1
vote
2answers
606 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
168 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
72 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
159 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 ...
1
vote
1answer
494 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
974 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
2k 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
101 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
506 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
228 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
349 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 ...