Questions tagged [metabox]

Refers to a box-like reusable user-interface component common in the WordPress backend.

Filter by
Sorted by
Tagged with
0
votes
1answer
1k views

Add other all taxonomies as meta boxes to custom post type

I have a custom post type which comes with a category taxonomy. This taxonomy shows as a meta box at the side. Pretty basic so far. Now I want to add additional meta boxes below the content on the "...
0
votes
1answer
28 views

I'm having trouble with Related Product “tax_query” 'terms' value

I have two custom page types. the first is "product" and the second is "accessories". On the product page, there is the accessories category "inputs" raleted post. Inputs ...
0
votes
1answer
732 views

Get a different size of Image thumbnail while working with custom metabox

I am using custom metabox for a page in my new project, I am using it for uploading image, and attaching it to the page. It's working fine, I can select image or upload the image using WordPress' ...
0
votes
2answers
586 views

Custom Metaboxes, multiple post selection

I have the following custom meta-box, which works to list a post type, I simply want to allow multiple values to be selected but cannot get it to work, it appears if I tell the select to store ...
0
votes
0answers
18 views

How to make a complete Meta Box part of a complete Post Type?

I receive the code complete, but I don't know how to make the Post Type loads the MetaBox when creating a new Post, here is the Post Type: if ( ! function_exists('cpt_campaign_details') ) { // ...
4
votes
2answers
28k views

How to add multiple images to custom post type?

I would like to create a simple plugin to add multiple images to a custom post type. I have created a plugin to add a single image to a custom post type, but I am unable to figure out how to add ...
0
votes
0answers
7 views

How can i create social media icons with link using meta box in custom post type?

function thegem_team_persons_register_meta_box($post) { add_meta_box('thegem_team_person_settings', __('Person Settings', 'thegem'), 'thegem_team_person_settings_box', 'thegem_team_person', 'normal', '...
0
votes
2answers
36 views

Show meta box only for default page template

I'm having an issue with one of my meta box. I want the meta box displayed only on the default page template editing page.php. The meta box doesn't show up on the editing page. add_action('...
0
votes
1answer
784 views

after checked the checkbox in backend, dont show social link on frontend

I want to do something like if I checked/unchecked a checkbox in admin then all social links in the page footer on fronted hide/show. function add_custom_meta_box() {add_meta_box("demo-meta-box", "...
0
votes
2answers
3k views

Adding an extra parameter [string] to my posts' permalink?

I've been searching the internet for 6 hours now, so I decided to ask this in the forum and would appreciate every help. I just want my permalink to say (e.g. portfolio, post, etc) http://mysite.com/...
2
votes
1answer
851 views

Best choice of options/settings framework for plugin/theme development

My question is what is the best options/settings framework out there now to safely build custom plugin/theme upon? I found the similar question here, but it was asked 7 years ago and definitely, ...
0
votes
0answers
24 views

I want to create post inside custom post types

I try to make a theme for Movie Series and I want to create custom post types "Series" with make post "Episode" inside by custom field/metabox. And then url like: domain/series/...
0
votes
0answers
13 views

Metabox repeatable fields with select options

In my dashboard admin, I have two metaboxes with repeatable fields in the same page. The first metabox has only one input value $field[tag_filter]. The second metabox has a select tag to display ...
0
votes
0answers
14 views

Grab data Metabox repeatable fields to display inside other Metabox

In the admin dashboard, I have two Metaboxes with repeatable fields inside the same page. The first Metabox is a list of names of activities for teachers. Each activities is a row with only one input ...
0
votes
0answers
12 views

Metabox repeatable fields issue when adding second field

I have a Metabox with repeatable fields. My first input is $field[tag_filter], it works fine. What I'm trying to do is adding a second input $field[tag_ref]. Unfortunately with the second input the ...
0
votes
1answer
808 views

Metabox value for post loop?

I created metabox.If the checkbox is checked if the posts are listed. How do I browse the posts marked with checkbox ? Metabox Code. Metabox output:
4
votes
3answers
3k views

Auto close (hide) custom metabox / set default state

I am using the WordPress function add_meta_box() to add my own custom metabox. So how can I auto close/hide on page open ? Currently, I just add a CSS class closed to metabox's <div> element ...
1
vote
2answers
267 views

Meta box html is not updating after saving

I have some meta boxes setup, some are my own, some are initialized in plugins. As the title indicates, these meta boxes are not updating graphically after the post has been submitted. Here's an ...
3
votes
1answer
87 views

add_meta_boxes action with refresh on save

I've created a meta box using add_meta_boxes action and it works when I open any post to edit it. add_action('add_meta_boxes', function() { add_meta_box( ... ); }); When WP auto ...
0
votes
1answer
994 views

Adding Meta Box to Specific Submenu Page

I've created this page: function wpdocs_register_my_setting() { add_submenu_page( 'edit.php?post_type=task', 'View Tasks', 'View Tasks', 'manage_options', '...
0
votes
1answer
641 views

Custom metabox does not store data

I'm troubled with a custom metabox, could someone give me a helping hand? I've got a custom post type which uses it, but unfortunately it's not storing the data into the database. Any clue? ...
0
votes
1answer
719 views

save metabox with new values _wp_page_template

I created a metabox to display the page templates and select a different one with a radiobutton selection. This is a replacement for the current page attributes metabox. I'm missing something with ...
0
votes
1answer
33 views

Illegal string offset in PHP function

I'm creating a metabox to upload PDF files. I have the following warning notice for this line of code: $this_file = $filearray['url']; Warning: Illegal string offset ‘url’ in... The complete function ...
0
votes
1answer
813 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 ...
1
vote
1answer
601 views

How do you List all Sidebars in a Metabox

I know this question has been answered many times before, including here where i came from so it'll probably be real simple. I've registered my sidebars as normal function wmw_sidebars() { // ...
0
votes
0answers
12 views

How to show error message in admin panel using WordPress?

I'm using WordPress and I want to add validation for the save_meta_data function and if the request isn't validated admin panel should show the error message. my code is here: public function ...
13
votes
3answers
26k views

Custom Taxonomy as checkbox or dropdown

I have registered a custom tax to my CPT. On the edit screen the tax meta box appears with an autocomplete field. Is it possible to display it as checkboxes or dropdown instead?
1
vote
2answers
662 views

Adding Meta Boxes while Registering a Post Type in a Class

I am trying to add a few meta boxes for a Custom Post Type through a Class. I am using the "register_meta_box_cb" parameter while registering the Custom Post Type to specify the callback function for ...
0
votes
0answers
23 views

Display metabox galleries on specific page template in admin editor

I'm building a Wordpress website with two metabox galleries displayed only on post type page in admin editor. What I'm trying to do is to display them only for a specific template page in the admin ...
0
votes
0answers
25 views

Add metabox to pages that use custom template in WordPress

I am trying to add custom metaboxes to only those pages that use a certain custom template that is applied to them. How can i do this? I based on this this guide: How to add add_meta_box to specific ...
1
vote
2answers
897 views

Wordpress from url get external source title

Hi I am building a news website. I am trying to automate it. News url (metabox) Title Content area Image (featured image option on wordpress) When paste the site url I would like the other metabox ...
12
votes
4answers
9k views

Trigger Javascript on Gutenberg (Block Editor) Save

So I have a metabox which I want to trigger some Javascript when a post is saved (to refresh the page in this use case.) In Classic Editor, this can be done via a simple redirect hooked to save_post ...
0
votes
1answer
704 views

How to add a custom meta box below publish box in CPT that is like publish meta box and can contains html?

How can i add a custom meta box below publish box in CPT that will be like publish meta box and contain some html code? See the attached shot for more info.
1
vote
1answer
801 views

Custom Meta Box (SELECT) Not Saving

I am trying to create a meta box with select options for each page with home-page-template.php assigned to it. I have got that functionality working correctly. I also want it above the editor, below ...
1
vote
0answers
28 views

How to use custom form on add_meta_boxes callback

I am trying to trigger the echo when the form button will click. but not able to do this. if I don't use form and direct echo there. this is working. but when I use a form, it's not working. can ...
0
votes
2answers
2k 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
1answer
14 views

How to 'clone' select metabox options with a callback function? [closed]

Here is my metabox array( 'id' => 'all_btns', 'name' => 'Button Select', 'type' => 'select', 'options' => array( 'button' =&...
1
vote
1answer
32 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 ...
1
vote
1answer
15 views

WP nonce field checkbox prints checked='checked' outside input field

I'm currently creating a custom post type in wich I want to add some custom meta boxes. All the fields just go as expected excepting a checkbox field wich prints on the html checked='checked' after ...
0
votes
0answers
25 views

Render metabox gallery in frontend

I'm building two metabox galleries on the same page with the help of a tutorial. The code works fine. However the galleries are automatically displayed after the content on the front end. What I would ...
0
votes
1answer
1k views

WordPress AJAX load post metadata in modal

I have a custom page template (front-page.php) and I have a custom metabox which is assigned to this page template. Metabox have 7 sections, and each section have 2 inputs. It looks like: 1. Client ...
0
votes
0answers
21 views

Making custom meta box required (with error message if not filled in) on Gutenberg

<input required name="myName" type="text" value="<?php echo $myValue; ?>" class="regular-text"> Does not produce an error message if the field is ...
0
votes
3answers
1k views

Include custom fields into the content of a regular page

Here's my setup: Parent "Gallery" page: _regular page, not custom type or anything _ Several "Project" child pages (could be as few as 1, unlimited number): also normal pages Child pages will either ...
1
vote
1answer
673 views

Found 2 elements with non-unique id (#_ajax_nonce) and (#_wpnonce)

I am developing custom theme from scratch and creates a custom post type and getting this warning while editing custom post type. I also design custom Meta box with two input fields and using nonce in ...
1
vote
0answers
40 views

HTML for adding a meta box (basic text field) to page editor?

I am following this tutorial from to add a meta box to pages of a certain page template. Unfortunately the code omits the part on how to create the actual meta box on the page (the HTML). The code in ...
1
vote
0answers
18 views

Create custom Content Editor for CPT [closed]

Hi I'm new to Wordpress theme dev. I'm trying ro create a custom theme (child theme) in order to create a CPT for books. There I would like to have 3 separate WYSIWYG editors (english, french, german) ...
0
votes
1answer
984 views

Repeatable field within repeatable group of fields

Compounding on Saving metabox repeatable fields ... I've created a metabox with a series of fields that are repeatable. However, within those fields, I'd like to create another field named Choices ...
3
votes
2answers
5k views

Displaying Meta Box Image

I have some problems displaying info from my custom meta box in my custom post type single. I'm using Reusable Custom Wordpress Meta Boxes by Tammy Hart. I'm able to display the textfields using this:...
0
votes
0answers
19 views

how to only allow one selection to be made in meta box

Okay so I have one metabox for my CPT and it has multiple dropdowns in it. I need help in only allowing one selection to be made. if ( get_post_meta( $post->ID, 'item_type', true ) == 'page' ) { ...
0
votes
1answer
1k views

Create Meta boxes dynamically

I followed and created a meta box using all code from this question here: Create more Meta Boxes as needed Basically only two fields are created when you click on Add track button: Song title field ...

1
2 3 4 5
33