Post meta is a data set containing additional core as well as custom post information.
6
votes
4answers
13k views
WP insert post PHP function and Custom Fields
The wordpress function is used for submitting data programatically. Standard fields to submit to incude the content, excerpt, title, date and many more.
What there is no documentation for is how to ...
8
votes
3answers
3k views
Passing error/warning messages from a meta box to “admin_notices”
I have a simple meta box that updates the post custom fields (using update_post_meta()).
How can I send a error or warning message to the next page after the user publishes/updates the post and ...
4
votes
2answers
3k views
How to hook update_post_meta and delete_post_meta?
I'm still struggling to get my head around this whole hooking into things, so I'm really stuck on trying to do the following task:
If update_post_meta is fired then check to see if the meta_key is ...
4
votes
2answers
1k views
post formats - how to switch meta boxes when changing format?
Problem
After realizing that post formats are pretty popular, but only a extremly rough drawn concept, i see that users will run into possible traps.
Post format ...
uses post meta fields & ...
7
votes
4answers
8k views
How can I show posts only if meta_value is not empty
Three people have already tried to solve this, and we're coming up nil. I want to show only posts that have a value in the meta_key 'featured_image'.
So... if 'featured_image' is not empty, show the ...
1
vote
1answer
77 views
How do I retrieve multi-dimensional arrays from the wp_postmeta table, & display on a website?
I would like to retrieve multi-dimensional arrays (that have been created with metaboxes), & display them on the front end of a website using shortcodes.
My Question: How do I retrieve ...
9
votes
4answers
3k views
Post meta vs Seperate database tables
When developing plugins that requires data storage, what's the pros and cons of using one method or another ?
The explication given in the codex is not detailed.
Before jumping in with a whole ...
2
votes
2answers
2k views
Query between two meta values?
How do I limit the query by two custom meta fields, a start date and an end date? This is what my data looks like:
meta_key | meta_value |
------------------------|
start_date | 20100131 | //Jan ...
1
vote
1answer
366 views
Custom Post Type: Set post_title equal to a custom post type field
I’ve created a custom post type for employees in a company with some fields they have to fill (like E-mail, phone, etc.) and a select box which takes some values from another custom post type called ...
1
vote
3answers
273 views
Grossly inefficient wordpress loops!
I'm working on a site at the moment for an orchestra. The various members need to be listed, according to their instrument. The members have a custom post type of biography and I'm capturing the ...
0
votes
1answer
305 views
Custom Query: query by post custom meta data
So I have a custom post called event, but I need to query only those posts which have a custom metabox(is a checkbox) called `Show On The Homepage: and only if that checkbox is checked.
<?php
...
0
votes
1answer
596 views
How should I use posts_where to change meta_value from a string to integer?
How should I use posts_where to change meta_value from a string to integer?
3
votes
2answers
298 views
How to use Post Custom Metadata in Post Titles and Post Permalinks
I am very new to WordPress. How can I use post custom metadata in place of Post Titles, and as the Post Permalink? For example, instead of domain.com/the-post-title, the permalink would be ...
2
votes
2answers
355 views
Post metadata deletes itself
I'm using a custom post type for a portfolio. I have a few option in there, bring saved by update_post_meta(), it seems to work fine, but then out of the blue (within the hour), the data deletes its ...
1
vote
1answer
462 views
I can't set meta_key in my custom post type query
I've created a custom post, events, and saved the meta data event_year to each event. I'm trying to get a year's event archive. When I go the the following URL, the meta_key and meta_value are not ...
0
votes
1answer
43 views
Custom query with category exclusion and post-meta “whitelist”
I have two widgets, one shows News while the other shows everything except News (We'll call the second one Blog). The blog portion is currently working correctly.
The News posts are either ...
0
votes
1answer
4k views
How to get meta box values - WP tuts tutorial
I did these tree tutorials to create custom metaboxes.
wp.tutsplus.com/tutorials/reusable-custom-meta-boxes-part-1-intro-and-basic-fields/
...
3
votes
1answer
121 views
Adding an assisting editor box to Post page
I run a multiple author platform and to improve the moderation, I want to add a couple of assisting editors. I want to add a custom box to the Post page where the assisting editor can confirm which ...
7
votes
3answers
7k views
Order by meta value or date?
Got a custom field called startDate but its only on a few events. I was wondering if it isn't set for a post I could use post_date to generate the posts list?
// if meta_key _postmeta.startDate isn't ...
2
votes
1answer
130 views
How to set author for post AND post attachments
I have multiple author accounts on one of my WordPress installs. Often I will create a post, and set the author to be a different account. However, when I upload images into that post, their ...
2
votes
1answer
411 views
List posts under meta_value heading
I need to list completed (meta_value) projects for each year (meta_value), like this:
2006
- Project 1
- Project 2
...
2005
- Project 3
...
I found (here) a great piece of code to deal with I'm ...
0
votes
2answers
2k views
Wordpress wp_head() crap
I know, wp_head() is important, but it inject so much crap into the header, i like to get it out... and just add manually the 2-3 line of code i need..
BUT, and there is always a but, i need the ...
3
votes
2answers
580 views
How to add category to: 'wp-admin/post-new.php'?
I want to have a link to create a new post that sets the category also.
I have tried wp-admin/post-new.php?post_category=12 and wp-admin/post-new.php?cat=12, but neither worked. I also tried using ...
2
votes
3answers
3k views
WP_Query, custom sort and custom filter
Is it possible using WP_Query to return a filtered list of items based on the following criteria set? I seem to be struggling as there are numerous queries against custom fields.
Select all posts ...
1
vote
3answers
921 views
Why time functions show invalid time zone when using 'c' time format?
These are the functions I use in my theme to display the "entry-meta" which includes published and last modified dates (among others) of an article:
// Shows Author and Published Date
if ( ! ...
1
vote
1answer
94 views
how to interconnect custom post types?
I'd like to make a site about choirs, composers, conductors and singers. And so far I decided that I need to make a custom post type for "piece" -- any piece can be associated with choir[s], composer, ...
1
vote
1answer
625 views
Custom field values deleted when trashing custom post type
I've created a custom post type with 2 custom fields attached to it... When I create a post of this type and fill in the custom fields, the data is, in fact, saved to the db... However, if I trash one ...
1
vote
1answer
282 views
Set Expiration Date of a Post from the Frontend with wp_insert_post
i try to build a form that users posts from frontend,
everything works fine but i need to know if it's possible,
if i play with the 'post_date' => date('Y-m-d H:i:s')?
if i add a hidden field that ...
1
vote
1answer
1k views
meta_compare seems to be treating values as strings instead of integers as expected
Trying to use meta_compare as suggested in the codex:
query_posts('meta_key=miles&meta_compare=<=&meta_value=22');
Here is my code:
global $wp_query;
query_posts(
array_merge(
...
0
votes
2answers
1k views
How can I include meta box content when searching?
When I search on my site it currently doesn't search the content in my custom meta boxes.
How can I include this content when searching?
I'm registering my meta boxes as follows:
...
0
votes
1answer
238 views
Save both current and new version of post meta
I want to save two versions of my custom meta box data called "sidebar". I want to compare a new and old version of this data later on, so that is why I want to save a copy of the current "sidebar" to ...
2
votes
1answer
929 views
meta_query: using BETWEEN with floats and/or casting to DECIMAL
Each post has a lat/lng value attached to it via postmeta. I'm trying to grab all posts within a bounding lat/lng value. Here's the get_posts query:
$posts = get_posts(array(
'posts_per_page' ...
1
vote
2answers
484 views
Wordpress Menu Disappears when $query->query_vars['meta_key'] is set
I've set some meta variables on my WP posts. I want to be able to sort by these variables, and everything is working great except when I sort by either "views" or "likes". When I sort by either of ...
1
vote
1answer
469 views
Filtering posts by post meta data
I want to filter posts in such a way that only posts, for which get_post_meta($post->ID, "project_cat", true) (it returns a post ID) is equal to my specified value, are shown.
Any way to do this?
I ...
1
vote
3answers
229 views
Transients vs CRON +Custom Fields: Caching Data Per Post
Wanted some opinions on a solution I'm trying to come up with:
I have a fan/enthusiast plugin I'm working on for fans of TV shows. One of the custom post types attached to the plugin is a release ...
1
vote
2answers
445 views
Display info from custom fields in all images' HTML
Okay, I've been working on this all day and can't find the solution anywhere. I've created a custom field within the image upload screen (info first found here). The field stores the name of a ...
1
vote
3answers
2k views
Custom URl parameter
i have Wp blog that need to receive a custom paramter on category page for filter the posts like my rule.
For example:
http://mysite.com/category/teste?myvar=ABC
How can I get the myvar from ...
1
vote
1answer
1k views
How to store post meta in an array?
What is the best way to store post meta in an array (using a custom write box, know how to do that) so that all post meta is in a single custom field?
0
votes
2answers
35 views
Up/Down voting system for Wordpress
Looking in all posts with keywords "voting system, upvote, downvote", I can't find a satisfying solution for this issue, except accepting one of the available plugins, spend a lot of time undersanding ...
0
votes
0answers
10 views
problem retrieving specific custom meta [duplicate]
I want to retrieve just 2 custom fields from my post, this is what I've tried:
<?php echo get_post_meta(get_the_ID(), 'CLUB','DATES', true); ?>
This code is retrieving just the first one ...
0
votes
2answers
44 views
display specific custom fields
I have few custom field assigned for each post, like:
"Club" with value "club1"
"Date" with value "date1"
and so on...
Now, I want to display from all the custom fields just those 2 " club" and ...
0
votes
1answer
533 views
Get Advanced Custom Fields values before saving
Basically, I need to alter the info the user inputs into an advanced custom fields textbox before it is written to the database but I don't know how to grab it. I can only get it after it has been ...
0
votes
2answers
453 views
How Do I Use WP_Query to Run This Database Query as Search Result?
I have created a search box with a drop down box of 4 options to customize the search:
A general default search, no filter
A custom search according to the post title for a custom post type only.
A ...
0
votes
1answer
316 views
Having trouble with custom post type / meta box
I've been working on a custom post type meta-box implementation that allows me to change the post_date to match the value in my "date" meta-box.
The function works perfectly except when I try to add ...
0
votes
1answer
227 views
Custom Meta Box with variable number of fields
Here is what I wanna do and I basically would just like some ideas from someone more experienced that would help to get started in the right direction.
I have a custom post type (Exams) that has is ...
0
votes
2answers
5k views
WordPress how to sort by meta value?
how in WordPress can I sort by meta value?
In meta value I have "price" (float).
I make this query, but always get "Sorry, no posts matched your criteria".
$posts = query_posts( $query_string . ...
0
votes
1answer
372 views
Updating post meta for custom post types
I'm writing a plugin for work (still) and having one more issue.
I've added my meta boxes as needed. However, the problem I'm having occurs when saving the post. My snippets for saving pretty much ...
0
votes
1answer
727 views
Custom query with query_posts doesn't show post without certain meta_key
I'm using query_posts to sort order certain categories.
My code look like this:
query_posts('category_name=abs&orderby=meta_value_num&meta_key=field_ordering&order=DESC');
This does ...