All Questions
1,647 questions
1
vote
2
answers
1k
views
Orderby my needs in foreach loop like by title or something?
in a cpt i can check some values (checkboxes) in a metabox. i can access this values by
$meta = get_post_meta(get_the_ID(), '_custom-meta-box', true );
after that, i do a foreach loop:
foreach ($...
0
votes
1
answer
1k
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 ...
0
votes
2
answers
991
views
Custom metabox with image gallery upload that won't attach images to post
I have created a custom metabox with an image uploader that will upload multiple images into a gallery that I can then query. It all works accept for the fact that the images don't show as attached to ...
0
votes
1
answer
1k
views
Get value of submit button in custom post type
I'm trying to make a quiz plugin. Using a custom post type, I've made a meta box, that has the following form table in it.
<table class="form-table">
<tbody>
<...
1
vote
1
answer
2k
views
How to Upload CSV Data into Custom Post Type Data with Metabox programmatically
I have a Custom Post Type called movies which had only title enabled from post support and 3 custom field of metabax as box office, year, and director like
now I have like 150 rows CSV formatted ...
0
votes
2
answers
771
views
Add URL to selected post in meta box
How can I change this code
$posts = get_posts(array('post_type'=> 'lesson', 'post_status'=> 'publish', 'suppress_filters' => false, 'posts_per_page'=>-1));
//here you add the ...
1
vote
1
answer
760
views
Getting List of all registered Dashboard Widgets
I am trying to get a list of all registered meta boxes in the wordpress admin, specifically the Dashboard widgets.
Now this is easily achieved with the global variable $wp_meta_boxes and does exactly ...
2
votes
2
answers
1k
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 ...
1
vote
2
answers
1k
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 ...
0
votes
1
answer
1k
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 ...
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
1
answer
2k
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
1
answer
28
views
Two related taxonomies. how to filter terms in second taxonomy depending on selected term in first taxonomy on Post edit page?
I have two custom taxonomies on the site - Countries and Cities.
The Country taxonomy contains over 200 terms, and the Cities taxonomy contains over 47,000 terms.
Naturally, editing content with ...
1
vote
1
answer
1k
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
2
answers
793
views
Outputing a metabox textarea and avoid line breaks inside li tags
I have added a custom metabox that holds string from a textarea in database. Now if I just simply echo the meta box like this:
$post_meta = get_post_meta($pid);
$answer = $post_meta["answer"][0];
...
1
vote
3
answers
2k
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 ...
3
votes
2
answers
6k
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:...
3
votes
1
answer
904
views
Show or hide custom meta box not work with Gutenberg
I’m on WordPress 5 beta 4,
the problem is that meta boxes can not hide them when selecting a specific template chosen by page attributes.
To make them appear or hide, you have to update the browser ...
0
votes
1
answer
2k
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
vote
1
answer
861
views
Adding metabox to wordpress plugins menu page
Now I am building a wordpress plugin. I need to add a metabox to the admin submenu page. I tried like this below,
add_action( 'add_meta_boxes', 'add_meta_boxs');
function add_meta_boxs()
{
...
0
votes
1
answer
2k
views
Allow HTML in Custom Metabox area
I know there are many questions related to my question, but sincerely i was unable to get solution.
My question is simple, how can i allow html in textarea in custom metabox on post.
So far i have ...
4
votes
1
answer
2k
views
Add custom buttons with custom actions in Edit Post screen in WordPress?
I am creating something for a client and I have a Class that I created with a Custom Post Type called 'PuSH Feeds' and when the user adds a new post and publishes it they can then click on one of two ...
0
votes
1
answer
2k
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
1
answer
29
views
Can't retrieve custom post type taxonomy term to custom post type editor
I have 2 main problems:
I can't seem to add editor_name custom field to default/native WordPress list of request URL query parameters.
This is the request WordPress is using:
http://localhost/wp-...
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 ...
16
votes
6
answers
15k
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
1
answer
41
views
My custom meta box with textarea field not saved
I created a custom meta box for my custom post type with address, phone, and map but only the map field type textarea not saved.
My code here:
// Add meta box
function vn_store_add_meta_box() {
...
0
votes
1
answer
16
views
Custom fields empty after refreshing page
I have added some custom fields to the Gutenberg editor, the purpose is getting these custom fields loaded in the custom-post-type.
Thats is all working, I was able to get the custom-fields in the ...
1
vote
1
answer
854
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
2
answers
228
views
Is there a way to remove the Add boxes from the Screen Options menu metabox?
I'm removing the default metaboxes like so:
function rh_remove_dashboard_widgets(){
remove_meta_box('dashboard_activity', 'dashboard', 'normal');
remove_meta_box('dashboard_right_now', '...
0
votes
0
answers
20
views
custom post type with metabox custom fields
how to make meta custom fields in custom post type name jobs_board_cpt , I am using boilerplate ?
public function jobs_board_cpt() {
$labels = array(
'name' => ...
1
vote
1
answer
46
views
Metabox conditionals depending on post format and template in Gutenberg
In the classic editor, I used jQuery to display metaboxes depending on the current post-format or page template selected. If a user selected a different format or template, they would toggle depending ...
1
vote
1
answer
4k
views
How to search by metadata using REST API
I have a custom post type like this:
register_post_type('horario_busao', [
'labels' => [
'name' => 'Horário Busões',
'singular_name' => 'Horário Busão'
],
'public'...
1
vote
3
answers
1k
views
How to position user meta data field
I have 1 additional field I want to display on the user profile page (mainly admin users will use this)
I have done it but it is showing up at the very bottom of the page, I want it to sit in the ...
22
votes
5
answers
30k
views
Remove Custom Taxonomy Metabox from Custom Post Type Screen
I have two hierarchical custom taxonomies, each on a corresponding custom post type. I would like to remove the metabox for each on the post type's edit screen.
I have read remove custom taxonomy ...
0
votes
2
answers
1k
views
Add custom metabox to media library images
Is it possible to add a custom meta box for the images of the media library?How I achieve this using add_post_meta() function?
1
vote
1
answer
369
views
Hide individual page title using checkbox in custom meta box?
I tried to write code to have a checkbox on Pages in the backend to check if I want to hide the title of the page in frontend. But I find that the post meta is sometimes reset to show the title even ...
0
votes
1
answer
37
views
Second featured image only shows in metabox preview after saving a post in the wordpress editor
I am trying to add a second featured image to the Wordpress post editor, and it seems all be working. When I select and image from the mediauploader the first time the image shows in the preview of ...
31
votes
3
answers
21k
views
Set Default Admin Screen options & Metabox Order
I am desperately looking for some way (any way) to set default "screen options" and metabox order through the functions.php file. does anyone have any help they can provide here?
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 ...
9
votes
6
answers
39k
views
How do I get attachment_id?
This is trivial, but I can't really find an answer, I've seen some hints like search in database etc., but this is madness.
Basically, I have a metabox with upload button that allows you to upload or ...
0
votes
0
answers
30
views
coauthors_plus_edit_authors to display metabox based on author caps
Need to display the coauthorplus metabox with author capabilities.
On the documentation of the plugin they say its only with super admin and editor that the metabox is available.
Any idea to add a ...
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 ...
0
votes
1
answer
89
views
doesn't save custom meta box data wordpress
My WP doesn't save my meta box data. I see the metabox and the field, but the data doesn't saving. Somebody could help me? Thank you. This is the code:
<?php
// Function to add a metabox
function ...
1
vote
1
answer
196
views
Using add_meta_box on a page with file upload and importing fields
This must be fairly simple :) I'm trying to import data into ACF repeater fields and am mostly following the answer to Add special meta box to custom post type
But what I have below isn't saving the ...
0
votes
1
answer
81
views
Only display top level taxonomy on the edit post page with option to expand sub-categories
We have a custom taxonomy that is hierarchical. It has so many sub-categories that to scroll through them in the edit post page is proving problematic for editors.
Is there a way to initially show ...
0
votes
2
answers
666
views
Remove All in One Seo from Posts for Contributors
I am using latest version of All In One Seo Package.
How can I remove metaboxes from posts for User Role: "Contributors"?
1
vote
1
answer
644
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
1
answer
677
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
1
answer
20
views
Saving custom input from settings sidebar of pages in Wordpress
I created a meta-box with an input field in the settings sidebar of pages. Now I try to save the value, but it does not work. Maybe the problem is, that I try to do this with pages and not with posts. ...