All Questions
1,647 questions
0
votes
1
answer
186
views
use post meta in add_meta_boxes action
Is there any way to use get_post_meta within a function called by the add_meta_boxes action hook?
I only want to display the meta box if a specific post meta matches a regex, but so far, I have not ...
0
votes
1
answer
172
views
Specific Page that convert Hyperlink to anchor in nav menu
I extended my Walker_Nav_Menu that converting hyperlink to anchor as I'm making one page website. Here is the code:
class description_walker extends Walker_Nav_Menu{
function start_el(&$output, ...
0
votes
1
answer
299
views
Generating image sizes when uploading through wp.media
Finding documentation on wp.media is really tough, so bear with me.
I'm creating a metabox to attach images to a custom post type. I'm able to get a media frame to open, have it accept uploads, and ...
0
votes
1
answer
257
views
problem with updating metabox of upload image
I created a custom post type and metabox for uploading another image. the problem is when i add the image its shown correctly in its place in backend and when i update its also the same i had the ...
0
votes
2
answers
3k
views
Custom meta box repeated field
I want to add a field in my custom meta box, same as below, but not for tags. How can I repeatedly take more inputs in the same field?
Here is my code added to functions.php:
function ...
0
votes
0
answers
350
views
Search form to find custom meta box generated data
I have developed an inner theme plugin, which is a custom meta box that inserts some typed in text to the database and then displays in the application.
I followed the example found at this link. Now ...
0
votes
0
answers
952
views
Problem with 'save_post' hook not running
I have a custom post type, with a custom meta box which contains a number of input fields.
The meta box is displaying fine but when completing all the fields the data is not saving, in fact, the ...
0
votes
1
answer
93
views
How to make post page unique and show it on home page?
I don't know if the title is correct but I'll try to explain my question below.
I have created a custom post type "Projects" and the trick is that one project have to be unique and displayed on ...
0
votes
1
answer
217
views
Why is the text displaying, but not the textarea field itself?
So, I have a textarea as a field in a meta box, if I do this it works OK:
$meta = get_post_meta($post->ID, 'twitter_embed', true);
echo '<table class="form-table">';
echo '<tr>...
0
votes
1
answer
152
views
Custom meta box save values issues - Deprecated: Function ereg() and more
I'm a WP theme dev nobie and I have problems with saving custom meta boxes values.
I found some tutorial where its explained how to do this.
I have included a file called custom-meta-boxes-save.php ...
0
votes
1
answer
482
views
Multiple category filters
I'm working on an events plugin for a client and I need several 'categories filters'. Now I have arguments for a post type, I've registered that post type and taxonomy, and I created another taxonomy. ...
0
votes
0
answers
247
views
Custom meta-box for all custom post types
I want to create a custom meta-box for all custom post types: post, page, and every custom post type (portfolio, testimonials, FAQs, quotes, reviews...). But without writing them into the array:
'...
0
votes
1
answer
2k
views
Edit post meta direct from post.php?
Does anyone know of an easy way to be able to edit ALL of a single post's meta at once ie on the post.php &action=edit page?
As some of the meta has been put in there with the update_post_meta() ...
0
votes
1
answer
785
views
How can add metabox for post of specific category before save post and after save post [duplicate]
I want to add Metabox for the posts of category=5 and i am using the following code but unable to do so . So please help me out->
add_action('admin_init','my_meta_init');
function my_meta_init()
{
...
0
votes
0
answers
118
views
Disable drag metaboxes, create many functions using js not to work!
when i Disable dragging metaboxes in admin, it seems to make some problems.
when i use this code:
function disable_drag_metaboxs() {
wp_deregister_script('postbox');
}
add_action( 'admin_init', '...
0
votes
2
answers
102
views
Looking for suggestions on creating simple database (Help!!)
I'm working on creating a basic database for a theatre and really need some suggestions as the best way to approach this.
Each production from this theatre will have its own page. The page should ...
0
votes
1
answer
28
views
Some comment box wordpress in 1 post [closed]
Can I add more sections to comment on the same post? For example, I have an Entry and it has 4 tabs, In every tab you need a comments section, Is this possible? Thanks
0
votes
1
answer
382
views
Using Meta Boxes in a Custom Page Template
I'm doing some custom coding and creating a new page template to use for a new page within Wordpress. I'm trying to add a meta box to the page to be displayed as output to the user. I tried to do the ...
0
votes
1
answer
750
views
meta_box: update_post_meta for <input disabled>
I have code (add custom field to post edit page):
case 'text':
echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta ? $meta : $field['std'], '" ...
0
votes
1
answer
223
views
How can i embbed two different galleries in custom post type
I have a created a custom post type 'services'.I want to upload and embed two different galleries.
I researched and got various codes to create meta boxes from where one can upload the image.
But ...
0
votes
2
answers
3k
views
How to show/hide a meta box using categories, with a different post type
The following code hides a meta box when certain categories are selected using jquery, in post editor. It works with post as the custom post type. I need it to work with a custom post type called ...
0
votes
1
answer
157
views
Get all Custom Post Types
I am creating a WP theme with a built in custom post type (and I am using WPAlchemy to add a couple of custom metaboxes).
$theme_custom_metabox = new WPAlchemy_MetaBox(
array(
'id' => '...
0
votes
1
answer
341
views
Meta box checkbox won't save
I have several fields mostly text inputs to save additional info to the posts, all the text boxes save but i cant't get the checkbox to save the value!
Wondered whether any of you geniuses out there ...
0
votes
1
answer
539
views
When post is updated, custom metadata in text area field is overwritten
I have set up 2 new post meta fields in order to add functionality to a custom post type. The custom fields generally work as expected, with a couple exceptions. I set up a checkbox (called "...
0
votes
1
answer
31
views
How to Arrange Support => Thumbnail
Good Afternoon,
I've created a CPT that mainly uses Featured Images, I would like to know how to rearrange this box to appear in the center where 'content editor' would go instead of the right (...
0
votes
0
answers
1k
views
A correct hook for saving meta boxes data
Nothing happens when I do the var_dump() in a callback on post save.
Here are the hooks I've tried:
save_post as shown in the codex
pre_post_update as suggested here
wp_insert_post_data found in ...
0
votes
0
answers
75
views
Does a codex exist for creating meta boxes in taxonomy
I am looking for WordPress official documentation to create meta boxes in a taxonomy. There are many tutorials, but each of them is completely different. I don't want to use any plugins. I need the ...
0
votes
1
answer
271
views
Problem in custom meta boxes
I am trying to create a custom meta box "Set your mood" which will display the mood of user but unfortunately meta box is not saving value. Please help
This is my code
<?php
/**
* Adds a box to ...
0
votes
1
answer
194
views
Default taxonomy 'post_tag' added to CPT managing by custom role : nothing in the metabox
I've created a Custom post type, which a custom role can manage : it has only the capabilities for managing this CPT.
When registering the CPT, I've set the argument : 'taxonomies' => array( '...
0
votes
1
answer
38
views
Metaboxes - why they don't render php in expected manner?
I was playing with metaboxes following one tutorial. I came to a point where I could add any code and it would be displayed in the metabox. I tried echoing something and it was ok. Then I wanted to ...
0
votes
0
answers
1k
views
custom field meta-box with dropdown/autocomplete
Is it possible to have a custom metabox with the ability to either:
enter a new meta_value in a certain meta_key
OR
choose from a list of the existing meta_keys, from a dropdown/select-box, ...
0
votes
0
answers
98
views
Display a post based on its metabox selection
I created a client portal where a client can view their projects. I have two user accounts "Clients" and "Administrator. Both clients and administrator are redirected to the frontend of the site to a ...
0
votes
0
answers
81
views
Ridiculous problem with CDATA [duplicate]
I'm using this great metabox plugin:
https://github.com/WebDevStudios/CMB2
I created a repeatable field (with only one textarea that you can duplicate)
It's working great. Now, I want to export some ...
0
votes
1
answer
43
views
Issue with file paths after porting metabox from main theme to child theme
I've got a custom metabox written for another site that I'm porting over, originally this was written directly onto the theme (rather than using a child theme).
The metabox itself was developed ...
0
votes
1
answer
856
views
Call the latest posts from a custom field group to be displayed on front-page
i have this custom Metabox field group from https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#group containing 3 fields and displayed on the Products page ...
0
votes
1
answer
30
views
Error in get post by met_key
I have this code,
$type = get_the_ID();
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$units3 = new wp_query( array( 'post_type' => 'units' ,
...
0
votes
0
answers
136
views
Add different meta box based on taxonomy
i created a plugin with a custom post type.
I added a new custom taxonomy also under that post type .
How can i add the meta boxes based on different taxonomy.
if( is_object_in_term('', 'name of ...
0
votes
0
answers
345
views
Not Able to Display Metabox Saved Checkbox and Selected option After Save/ Update
am using this code to create a Metabox for CPT. Now I am able to view the updateded / saved Text input on post but the Checkbox and selected options return null after save or update. Can you please ...
0
votes
1
answer
86
views
Howto: use existing post_meta as options for a different metabox (checkboxes or list)
I want to create an "Employee" Custom Post Type ("Add New Employee") wherein the employee may belong to one or many offices.
The user needs to be able to add/edit/delete offices via a separate "...
0
votes
1
answer
82
views
Custom sortable pages on custom post type
I created a custom post type but I want to put a functionality like the Menu Options located on Appearance>Menu.
Which I can just choose a page on the side metabox then add it on the sortable area.
...
0
votes
0
answers
732
views
Add "Select" For Custom Post Type Metabox
My Question is partially based on this tutorial:
http://code.tutsplus.com/tutorials/how-to-display-metaboxes-according-to-the-current-post-format--wp-27970
I'm trying to add a new "select" field. ...
0
votes
2
answers
2k
views
Custom meta box not saving values of radio buttons in Wordpress
I dont know where i am going wrong.I want to save the values of my radio buttons in custom meta box.Here is my code.
<?php
if (!function_exists('custom_meta_box')) {
function ...
0
votes
1
answer
681
views
Adding to an array & passing it through do_action/apply_filters
For exercise I am working through a PHP class to add meta boxes I found on GitHub. I just copied the code and now I am playing around with it to understand it.
It works like this: The file ...
0
votes
1
answer
105
views
Meta Box value not been pulled in
Here is the code that creates my metabox on my CPT named clients it displays fine and seems to keep the value input upon clicking update. The problem is with displaying the value saved within the ...
0
votes
1
answer
1k
views
Repeatable WordPress custom fields in a metabox
I would like to create a meta box where the user can add or remove a simple input field that holds an image url on posts.
0
votes
1
answer
1k
views
Can't save drop down select date in meta boxes
I want to update my select options(drop down) but i don't know where i made a mistake.Here is my code.
<?php
function display_post_options(){
wp_nonce_field( basename( __FILE__ ), '...
0
votes
0
answers
598
views
Meta-Box to add multiple items one at a time and on publish save all
My example custom content type is for recipes. There will be a meta-box for ingredients. In this meta-box there will be three attributes and a "add" button.
Name
Measurements
Notes
Add Button
My ...
0
votes
0
answers
483
views
Attaching meta box to specific category/taxonomy in custom post type
I have this case here and can't figure out how to do it. I have a custom post type with taxonomies and a meta boxes to that specific post type. The idea is some metaboxes to appear only when category/...
0
votes
1
answer
398
views
Adding Metabox Value Using the content filter
I am able to show repeater metabox on index and single post .Now I want to show this using
add_filter( 'the_content', 'theme_slug_filter_the_content' );
My code to get meta value
<?php
$data = ...
0
votes
1
answer
680
views
update_post_meta does not work
I have meta box in my custom post type where I receive data from a front end form. The issue is that somewhere in this functions, something goes wrong and the data changed in admin edit panel does not ...