Post meta is a data set containing additional core as well as custom post information.
0
votes
1answer
19 views
Cache metadata for set of posts
I have a query that can only be done using straight SQL, but I need to loop through the returns as a set of posts. As I understand it, WP_Query automatically gets all the metadata for all the posts ...
0
votes
1answer
30 views
Does post-meta belong in header?
The template I used as a start for my own design places the metadata inside the header tag of the single-post.php. Is that a correct use of header, or should there only be h-tags in there? What about ...
1
vote
1answer
53 views
How to add a new meta key and assign timestamp to posts
I've been trying to look for a way to create a loop in my website and show posts being read/watched but have not found anything.
The only way I can accomplish this would be to create a new meta key ...
0
votes
1answer
30 views
Multiplicate entry on update_post_meta
I have a metabox with an array of input:
<input type="text" name="activite_dates[]" size="30" /><br />
<input type="text" name="activite_dates[]" size="30" /><br />
<input ...
-3
votes
2answers
47 views
How can i put a custom field inside this php
Hy, i want to count years of an actor.
The date that actor is born is stored in a custom field.
$date = get_field('data_nasterii');
Date stored in custom field is : yymmdd
How can i stick bouth ...
0
votes
1answer
51 views
Saving zero as meta value
I have a meta_key called "_ordre" and each time I create a new custom post, a new meta_value is set for that meta_key.
The thing is, when I set the value of '_ordre' to 0, the meta_value is not saved ...
1
vote
1answer
293 views
Auto sort the wp-admin post list by a meta key
I am using this following code in my functions file to hide and add some custom columns to my post-edit screen in wp-admin.
I am now trying to get the post list to sort by a post meta field (last ...
2
votes
2answers
51 views
Identifying Importer Posts
Given a site with 100 posts, where an unspecified number of posts are manually written, and the rest are created using the WordPress importer, how would I programmatically identify the posts imported ...
3
votes
2answers
183 views
Get a single post by a unique meta value
Is there a fast way to retrieve a specific post by a unique meta value? I could run a meta_query and then loop through the first value to get the post's ID, but I am wondering if there is any other ...
0
votes
0answers
43 views
trying to add several meta boxes and when callbacks are called there is an error [closed]
I am making a plugin that adds meta boxes to post. i have a function that currently defines 3 meta boxes. now when i define the callback that prints the mockup there seems to be a problem
I get the ...
0
votes
1answer
55 views
How can I sort posts by the date and a custom meta field?
I have custom meta field that I use for the post rating.
So I want to display posts by the date and the rating, but only for the posts that have specific rating.
For example, I want to display posts ...
1
vote
1answer
513 views
Query all posts where a meta key does not exist
I am trying to get a query to retrieve all the posts where a specific meta_key does not exist and then create it.
I am having problems finding those posts as the query I am testing does not seem to ...
0
votes
1answer
40 views
When editing a post with a custom meta box the values aren't displaying correctly
I followed this tutorial to create a custom meta box with a simple two option drop down.
My code is below. The custom fields are saved when creating a post, and edit when I change the value and ...
0
votes
1answer
197 views
wpColorPicker - problem with implementation to post meta
I need your help as I am stuck and Google does not return anything, so I must be doing something obiusly wrong here, I just don't know what.
Basically, I need color input in one of my custom post ...
0
votes
1answer
78 views
get_posts in meta box dropdown not showing latest posts
I’ve got a metabox I set up using WPAlchemy that allows authors to add a link to an associated post. It’s been working fine for months but now for some reason the dropdown with the appropriate posts ...
1
vote
2answers
216 views
Custom post type category not displaying in custom post type
I've created a new custom post type (lets call it "Reviews") on the backend of my Wordpress. It works fine for the most part but the Categories I create within that Custom Post Type are not displaying ...
0
votes
1answer
158 views
How to insert multiple postmeta values with one query?
I have a custom script/plugin I am using for myself that creates a post along with some postmeta information. Right now, I have multiple $wpdb->insert, but I would like to condense this down into ...
0
votes
1answer
345 views
Repeatable custom meta fields
I am working on creating custom meta boxes for the back-end of WordPress.
I would like to add a metabox with several fields, in my case an image upload and a text input, but with a button that can ...
1
vote
1answer
151 views
How do I sort a custom post type admin column using two meta keys?
I have created a custom post type along with custom columns. One of my columns displays a date range such as "12/05/2012 - 11:00 am to 12/15/2012 - 1:00 pm". This is a concatenated string using a ...
3
votes
2answers
590 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 ...
0
votes
1answer
74 views
Function to return values from metabox
I have created two custom metaboxes using the Meta Box plugin for my cpt called books, and I am confused how to output the values. The values need to be used in sperate places in one of my templates. ...
1
vote
1answer
85 views
Job of meta_key meta_value fields in database tables
I'm researching the structure of WordPress database and there is something that really get me confuesd.
Could someone please explain, what is the exact job of meta_key and meta_value fields in ...
4
votes
1answer
128 views
What is the advantage of the wp_options design pattern?
As we all know, a design pattern that is used frequently in Wordpress' DB code is the idea of persisting data for a particular object (blog/post/comment), indexed with a particular name or key.
We ...
0
votes
2answers
241 views
How to get custom image field of specific post id
I have a page where I'm pulling in content from another post, outside of the loop.
I've been successfull at getting the content of the specified post, but I cannot get the image from a custom field ...
1
vote
1answer
51 views
Post meta not updating
I am trying to make a voting system for WordPress.
This is my code in functions.php:
add_action("wp_ajax_add_votes_options", "add_votes_options");
add_action("wp_ajax_nopriv_add_votes_options", ...
-3
votes
2answers
41 views
Chance post id into post name
I´d like to echo the post name instead post id. My code shows just the id.
<?php
global $post;
$customlink = get_post_meta( $post->ID, 'clink', true );
echo $customlink;
?>
Thanks
Ogni
0
votes
1answer
62 views
Site 'Categories': save an admin global setting with post metadata [closed]
In WPMU, we are using Site Categories (with Sitewide Tags), but for the life of me I can't see how the category of the sub-site (say, departments in a school) to which each blog belongs ends up in the ...
0
votes
2answers
151 views
order by multiple meta_keys?
Hi i'd like to order by multiple meta_keys
want to make it order using these keys
adminscore + user_like + _count-views_all + comment_count
combine these keys how should i array order it??
i try ...
0
votes
2answers
114 views
PHP Notice error (when on 404 page)
I have a 404.php template for my theme. I also have WP_DEBUG in wp-config.php set to TRUE.
Consider this 404 template:
get_header(); ?>
<div id="content" style="full-width">
<div ...
0
votes
1answer
189 views
WP_Query meta compare must include ALL array values
I am allowing users to query posts using a form with checkboxes. I want the posts to be filtered by the checkboxes but instead of showing all posts that include the ANY of the meta values selected I ...
1
vote
1answer
74 views
Importing Data from a Non-WordPress database, into WP
I'm migrating data from a totally different database style into WP. The main issue I'm trying to wrap my head around is how to import any meta data, given that WP uses a key value pair style for meta ...
1
vote
1answer
86 views
Retrieving an alt tag from a custom field
I have a theme that uses TimThumb to generate thumbnail images on a gallery page. The problem is that image alt tags are not showing for each image on the main gallery pages, see here:
...
1
vote
1answer
29 views
Get a row from a separate table by matching a posts meta_key to a tables ID column
I am trying to match a posts meta_key value to a separate tables column ID and call that row/array in the single-listing.php.
I have a meta_key value that is called dot_number. The table is called ...
0
votes
1answer
130 views
Add custom field automatically (add_post_meta) with value based on number of words of article
In this topic our friend @toscho created a function that sets the font size according to the number of words in the post. Based on this function, I want to create a custom field whose value will be ...
5
votes
2answers
321 views
Can the Next/Prev Post links be ordered by menu order or by a meta key?
I have a series of posts that are ordered by a meta_key value. They could also be arranged by menu order, if necessary.
The next/prev post links (generated by next_post_link, previous_post_link, or ...
0
votes
1answer
104 views
Advice Needed for Post Meta Database Efficiency
So I have this custom post type and I have atleast 20 custom meta boxes for it which means there will be 20 postmeta rows.
So my question is, since I have that many, would it make more sense to just ...
0
votes
1answer
84 views
How to make certain content of the post noindex and no follow. not entire post?
in my woocomemrce website i am trying to embade faqs which are generated using a short cut code . these faqs are common for all products which may lead to serious duplicate content issue . how to ...
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 ...
0
votes
1answer
57 views
Repeated nav bar queries failing to be cached
Every time a page view occurs, wordpress is sending a complex non-indexed query below. The exact same query is sent over and over and it seems that it is being passed through some "caching" code. But ...
0
votes
1answer
330 views
How to implement a Google map store locator
I have followed the following Google developer doc about creating a store locator usng PHP & MySql.
https://developers.google.com/maps/articles/phpsqlsearch_v3
I have this working but now I ...
2
votes
2answers
658 views
Can I exclude a post by meta key using pre_get_posts function?
I see many people prefer to use pre_get_posts hook instead of query_posts. The code below works and shows all posts which have meta key "featured"
function featured_posts( $query ) {
if ( ...
0
votes
1answer
118 views
meta post search
I need to query post meta fields, filtered by a multi checkbox
Currently, the query works only with second parameter (People) when the form is submitted.
How can I filter with two parameters?
...
-1
votes
1answer
330 views
0
votes
1answer
36 views
Add a meta field to the list of results for a custom post type
I've created a Custom Post Type for "Books" ... I've also added several meta fields (custom fields) to each book, and I'd like to be able to display some of those fields in the table of results.
Is ...
5
votes
2answers
159 views
Lack of composite indexes for meta tables
Why wp_commentmeta table does not have a composite index (comment_id, meta_key) by default? I believe it's the only useful index for that table, am I wrong?
Instead, it has a strange set of indexes:
...
0
votes
1answer
443 views
Remove Meta-boxes (Yoast SEO plugin) [duplicate]
Possible Duplicate:
WordPress SEO by Yoast: Hide Meta boxes in posts for non-admins
I was wondering how to remove Meta-boxes from the post page. I would like that only administrators or ...
0
votes
1answer
98 views
Exclude posts by post meta value
I have constructed this query to sort posts on the home page by a set position number in a custom field. However, I need to be able to exclude posts with the position set to '0'. Below is the code ...
0
votes
1answer
99 views
best way to use custom taxonomy, post type and meta in a job system
i am building a job system which will store following data:
job title - post title
description - content
location - post meta / taxonomy
sector (it/sales & etc)- custom taxonomy
salary start - ...
0
votes
1answer
536 views
get_post_meta - get a single value
When I do get_post_meta($post->ID, "company_wp_box_g", false) I am getting back an array of key/values pairs.
array (size=1)
0 =>
array (size=7)
'f_name' => string ...
1
vote
1answer
204 views
is there a way to show the the post title after the image?
Trying to show the post title after the image in the main blog page and single page, I have tried to edit the content.php but unable to achive the result I need, which is basiscally
IMAGE
TITLE
META ...