Questions tagged [post-meta]
Post meta is a data set containing additional core as well as custom post information.
1,971
questions
0
votes
1
answer
1k
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 ...
2
votes
2
answers
791
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 ...
2
votes
3
answers
7k
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
1
answer
751
views
query_posts() on key's value, or key's existence
I recently started using simple fields on a project to differentiate between types of posts. All posts from now on will have one of four possible meta values associated with this (Story, Article, ...
1
vote
2
answers
16k
views
using multiple meta_key and meta_value in query_posts
how can i use multiple meta_key and meta_value in query_posts?
For example, I want to find multiple content with two different meta_key and meta_value. How do I do this?
i using this code but not ...
1
vote
1
answer
948
views
Custom wp_query time filter on meta_value
My goal is to only show posts with opening hours after business hours, for a given day. So, e.g. I have a (custom) post with following meta_key and meta_value:
meta_key = 'monday, meta_value = '14:00 ...
3
votes
2
answers
1k
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 ...
0
votes
3
answers
502
views
Uknown meta entries in wp_postmeta
I'm working on a site that has been running for few years and had different maintainers so it's kind of a mess. What I found weird is a lot of entries in wp_postmeta where all the keys are numeric and ...
32
votes
5
answers
28k
views
Post meta vs separate database tables
When developing plugins that requires data storage, what's the pros and cons of using one method or another ?
The explanation given in the codex is not detailed:
Before jumping in with a whole new
...
1
vote
2
answers
4k
views
Query 2 meta key values and a category
I have a wp query that works great - it returns a list of featured posts.
WP_Query("category_name=office&meta_key=featured_post&meta_value=Yes&posts_per_page=3");
However I want to add ...
8
votes
2
answers
9k
views
Best way to programmatically remove a category/term from a post
I am working on a script to convert all posts in a given category to use a postmeta flag instead (testing of MySQL has shown me that on a site as large as mine this will lead to a meaningful decrease ...
0
votes
1
answer
863
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?
1
vote
1
answer
2k
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(
array(
...
2
votes
2
answers
868
views
Conditionally Query Custom Post Types by Post Meta for Blog Home Page?
(Moderator's note: The question's original title was: "Custom query: Show custom post types plus custom post type with post meta on blog homepage")
I'm in need of help with a custom query. I have ...
1
vote
2
answers
247
views
How to find time last viewed?
I want to run an update script on pages that haven't been viewed and updated within X days. I'm using post meta to cache some related RSS feed data, and I want it updated once a week or two, but only ...
0
votes
1
answer
394
views
How can I display a drop-down select of Post Names
I would like to add a custom write panel to a custom post type. I'm looking at the the code here:
http://wefunction.com/2009/10/revisited-creating-custom-write-panels-in-wordpress/
I can get the ...
1
vote
4
answers
230
views
Finding the page id
I'm not sure if I'm blind here, but short of digging directly into the database tables, where would I find the database id for a post or a page?
1
vote
1
answer
202
views
Routine to convert custom post meta from old to new value
I have two custom post meta objects that have been applied to all pages and posts in my sites. The names are MyCustomHeader and MyCustomTitle and I have one of these assigned to each post and page in ...
0
votes
1
answer
981
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 show ...
4
votes
2
answers
9k
views
Strategy to get post meta for use outside the loop
I need to know solutions for the question above.
There are cases, when we need post meta information outside the loop.
Let's say, I'm developing theme that will display ads from certain vendor on that ...
3
votes
3
answers
2k
views
How to create a mini directory in WordPress?
I'm looking to create a simple directory, something similar but not so powerful as SOBI2 for Joomla.
Is there something like this for Wordpress?
I want to store informations like:
Name
URL
Address (...