All Questions
38 questions
0
votes
1
answer
273
views
Store custom meta box data as serialized array
I have been trying to find out if it is better to store custom meta box fields for a custom post type individually or as a serialised array. On the web I have seen different approaches but which one ...
0
votes
1
answer
400
views
Meta Box WP_Query array for showing items with a certain relationship
in oxygen I am using a repeater to show posts that have a certain relationship. The advanced query in the relationship is post_type = "custom post type1" and then I add another parameter ...
0
votes
1
answer
142
views
Show metabox value last post excerpt, title and link
I'm facing a problem I can't solve.
I'd like to get the excerpt, title and link of the last post containing a particular meta-box button status.
For example: I would like to retrieve the last post ...
1
vote
1
answer
196
views
Custom Metabox data slow query on Admin init
recently my database got very large either in posts and postmeta, and when accessing the WP admin it loaded on init something like 700mb of data, and it was slowing down the entire backend.
I found ...
0
votes
1
answer
611
views
How to pass multiple custom fields as shortcode's parameters
I'm learning how to pass parameters in shorcode, I know the basic step after read through WP Codex.
But for now, I have plugin come with custom fields and as the title, I want to know how to do it.
...
2
votes
1
answer
957
views
How to get Metabox custom field to show checked if value is updated using post meta query?
I have two radio buttons as custom metabox fields for pages/posts. One radio button has the value of "enable" and the other has the value of "disable". My radio buttons will stay checked only if I ...
0
votes
1
answer
1k
views
Wp Query sort order from custom MetaBox
I am trying to sort a list of post based of the meta_key deal amount, which would be to display the highest deal first and work its way down to smaller deal amounts. The deal amount would be anywhere ...
0
votes
1
answer
663
views
Posts query according to meta box date
I'm struggling to get a working solution with wp_query for Event management, Currently post order by event start date & time work well. Now I want some custom settings.
Have two meta boxes ...
0
votes
1
answer
400
views
create metabox to activate slider
I want to create a checkbox on the Add Post page to enable the slider
When the checkbox is activated, that post displayed in the slider,
and i want to just write code i don't want to use any plugin.
0
votes
0
answers
1k
views
update_post_meta() not updating
I'm saving API data as metabox data, and I'm attempting to update metabox data on import. So the Title, content data will always update. But I can't seem to be able to use the ID to update the metabox!...
1
vote
2
answers
314
views
Automatic value for custom fields for posts
I have created custom fields for posts by using the add_meta_box action. I want to create my own WP Query based on my custom field, to make sure I will only load a post collection with the correct ...
0
votes
0
answers
283
views
Query by meta value (add a dropdown of all values)
I'm facing a problem I can't resolve alone.
I have a custom meta field named 'processeur' for a custom post type names 'ordinateur'.
What I need to to is get a list of all meta values, arrange them in ...
0
votes
0
answers
162
views
Wp Query sort order
Hey i have the following query sorting custom agendas posts on an archive page based on a metabox for the event date.
$args = array(
'post_type' => 'agendas',
'posts_per_page' => $...
0
votes
1
answer
585
views
Saving custom fields for WP_Query to retrieve
Thanks in advance for any help offered. I am writing a plugin for wordpress that has multiple custom post types sharing some custom meta boxes and fields. I have everything working and saving ...
0
votes
1
answer
337
views
How to show all the associated posts with specific date of data metabox?
I need someone to answer this question.
I have metabox which shows date:
$date = rwmb_meta( 'pb_match_date', '', $post->ID );
I want to get all the associated posts with specific date of that ...
23
votes
1
answer
43k
views
Order by multiple meta key and meta value [closed]
How can I set multiple meta keys order by meta value, can any one give me some example?
0
votes
2
answers
519
views
display post multiple times based on array of dates
I have a custom post type for a simple schedule list and using the meta box plugin i have two meta boxes assigned to custom post type. 1 for an image and 1 for an array of date times .
In my ...
0
votes
1
answer
793
views
Filter posts of custom post type by meta key in (List All Section)
How can I filter the posts which are displayed on the admin list all page of a custom post based on the value of the a value.
So far I know how to do the following anywhere on the front end:
$args = ...
0
votes
1
answer
74
views
Displaying a div from an assigned meta_value when on a page
On my website I created a custom metabox that is being displayed in the post type "page". The metabox will display a checkbox and 4 url fields. The checkbox will control the visibility of a div (...
0
votes
1
answer
7k
views
How do I add an item to the WP admin menu?
I want to add an item to my WordPress admin menu - "News" - it's to contain a list of articles written about my company.
Each article will consist of the following metadata:
Headline
Date
Link to ...
0
votes
1
answer
571
views
WP_Meta_Query object with conditionals
I have a custom post type (Books) that is connected with a second custom post type (People). The Books CPT has an additional author meta box that if checked, it should appear on the additional People ...
0
votes
1
answer
393
views
Query to get all the posts of more than 2 meta_value having same meta_key?
Meta_value will have checkbox infront of them so when both the check box is selected posts related to both the meta_value will be displayed.
4
votes
2
answers
24k
views
How to add multiple images to a custom post type single post?
I have created a custom post type and I need to add multiple images to every single post, so I can create a loop and use them in a slider. So far my search on Google etc. has turned up nothing.
What'...
1
vote
0
answers
807
views
New WP_Query loop in admin causes problems
I am working on a project where I have a custom post type 'companies' and on this edit page in the Wordpress admin I have some custom made meta boxes, for saving company information, opening hours, ...
0
votes
1
answer
5k
views
How to retrive Custom Post Type Meta Fields in Custom WP_Query
Can some one let me know How I can render the Custom Post Type Meta Fields (Meta-boxes). I have a Custom Post Type Called "News" and I successfully added a Metabox to my Custom Post Type called "News ...
2
votes
1
answer
4k
views
How to sort CPT by custom meta value (date), and return posts month by month
For future reference:
I am using the great Meta Box Plugin to help expedite meta box creation for my custom post types.
My goal:
To build a highly customizable events section closely resembling a ...
0
votes
2
answers
257
views
How to query custom post then display sections by meta value
This seems like an easy thing to do but I am missing something here. I have a custom post type called "recipient" and a meta check box called "yes_current" - (we help children with cancer and run ...
0
votes
1
answer
2k
views
Help with if statement inside while loop
I have the following snippet of code, basically I get the set value of id from the metabox, get the current id based on the loop, try and match, if htey match I want to pull the values from the ...
0
votes
1
answer
890
views
Retrieving meta-box from a custom-post-type
I am trying to display data from a custom post type on my home page, for which I am using a separate template.
I'm getting a Fatal error: Call to undefined method WP_Query::have_post() when my code ...
0
votes
1
answer
614
views
wp list pages using meta box value
I am using the following meta boxes on services page but how would I get the page(s) which have value of this meta box?
For example, list all pages where service_type = 'web'
I am using the ...
0
votes
1
answer
66
views
Adjust query on single
I am building an event manager. One of the template files I have is events-single.php which displays single events. At the bottom of this I have next and previous events using next_post_link and ...
3
votes
2
answers
13k
views
How to grab metabox value in wp_query meta_query key
How would I modify my WP_Query in order to get a custom meta box value instead of a custom field one like I currently do?
This is how my query looks like:
<?php $today = date("Y-m-d",mktime(0,0,0,...
0
votes
2
answers
2k
views
how to compare different timestamps in wp-query for events custom post types?
I have a custom post type with custom metaboxes (as seen on wptheming.com) and would like to make a query to show upcoming events, say in the sidebar, where past dates are left out.
But I need a ...
0
votes
1
answer
147
views
Inefficient Query Confusion
Edit #3 - meta_keys as an array
This seems to compare more than just the "opening_time" I can set the opening time for the wrong date or even leave it blank and it will still grab a post if the "...
0
votes
2
answers
954
views
Custom Post Type + Custom Meta Query Not Showing 2012 Posts
I created a custom "events" post type for a client that basically "hides" the post once it has expired (ie. the event already happened). The events are displayed in the order of the start date rather ...
1
vote
2
answers
2k
views
Meta box dropdown of custom posts
I am trying to display a dropdown select metabox on the "add new" page of a custom post type which displays a drop down list of titles from a separate custom post type ( it's an effort to relate the ...
5
votes
1
answer
11k
views
WP_Query with checkbox meta_query
I have posted this on StackOverflow too, not sure if that's allowed - if not let me know and I'll remove one (I don't want to look like I'm spamming). Anyway....
I have a custom post type and have ...
51
votes
14
answers
81k
views
meta_query with meta values as serialize arrays
I'm working on a project in which I'm creating a custom post type and custom data entered via meta boxes associated with my custom post type. For whatever reason I decided to code the meta boxes in ...