All Questions
1,647 questions
0
votes
1
answer
918
views
Creating an If/Else statement using WPAlchemy MetaBox radio boxs
I am using the WPAlchemy MetaBox Class to create additional metaboxs on my site. One has a section with a group of radio boxes. I've coded it as follows:
<?php $mb->the_field('docposs'); ...
0
votes
1
answer
248
views
PHP Puzzle: Unique Styles with PHP loop
The Puzzle:
I am currently working on a music blog that has various venues and numerous locations that are laid out at the top of each post as follows:
USA.California.Los Angeles. Hollywood Bowl
...
0
votes
1
answer
2k
views
Adding a custom "Add Custom Field" button to Custom Meta boxes
Did I use custom enough in the title? Here is a quick explanation of what I am doing. I am creating a genealogy site and I have a custom post type called "Ancestor" In this post type there is quite ...
0
votes
1
answer
2k
views
Custom select box meta field
For my custom post type i needed to add the Attribute Meta box, but i wanted to add an extra field to it.
So here i have copied the Page Attribute meta box code and added my select options, but i ...
0
votes
1
answer
4k
views
How to get the value of particular get $meta value in wordpress
I am using this wordpress Script to add metaboxes under posts..
I followed as it was written.. but I am having trouble on how to get those values in singe.php
Example an uploaded image
Please guide me ...
0
votes
1
answer
644
views
add a "list" into add meta box : problem
i found a code searching through stackexchange --> to create a "list" inside a meta box of a custom type, BUT, i don't see anything appearing in this meta box, except the input field (which comes from ...
0
votes
1
answer
3k
views
Metadata in loops
I have a standard Wordpress loop displaying items:
$loop = new WP_Query( array(
'post_type' => 'images',
'orderby' => 'menu_order',
) );
while (...
0
votes
1
answer
239
views
Move title "meta box" in post mode
I've created a custom post type with my own custom meta boxes.
Now I want to move the title box to the side or simply remove it and place the same content in a custom meta box.
How do I go about to ...
0
votes
1
answer
195
views
How to hide metaboxes in WordPress Admin on WooCommerce "Add Product" page - Remove side sortables for a specific user role
How do I hide certain metaboxes in WordPress Admin screen options for specific user roles?
For example, I allow the user role "Store Vendor" to access the WordPress admin to upload their ...
0
votes
1
answer
95
views
Category Template - to be editable from the backend?
I have different categories that includes posts of the category. I want to add text and images before or after the posts of the categories are displayed on the frontend. I want to solve this via ...
0
votes
1
answer
2k
views
Saving an upload media meta box field
I'm using the answer for this previous question (link below) to generate a custom meta box with media upload functionality:
Add "upload media" button in meta box field
I've managed to get ...
0
votes
3
answers
3k
views
Allow iframe in custom meta box
I've created a custom meta box called 'Location Map' and want to provide a functionality to the client to simply copy paste the location's google map's iframe embed code so that it directly appears on ...
0
votes
1
answer
193
views
Adding different classes to different images depending on size for fine control of image layout in posts
I have all the CSS classes set to display images in a custom portfolio theme. I am allowing for images of different sizes and proportions (landscape, portrait, etc) to be tiled next to each other and ...
0
votes
4
answers
2k
views
Possible to add meta box to edit.php pages?
I've been googling this for a while, and came across this link here: Can I limit this meta box to a particular page?
What I am trying to achieve is adding a custom Meta Boxe I created onto a CPT ...
0
votes
2
answers
4k
views
Display custom meta box in my template file
Need help displaying my custom meta boxes on a template file.
Following a tutorial
Here's the code from my functions.php:
function get_custom_field( $value ) {
global $post;
$custom_field = ...
-1
votes
2
answers
6k
views
Calling Data from Custom Meta Box
I have created a custom meta box which I have pasted in functions.php (minus the <?php call of course)
I have two fields in this meta box, one is labeled 'Primary Title' and the other is labeled '...
-1
votes
1
answer
81
views
Display custom field value into content with hyperlink
The following code helped me to display the "Custom Field" value in the the_content section.
But I need a help to make it to show as a hyperlink.
Here is the code:
function wpa_content_filter( $...
-1
votes
1
answer
1k
views
Meta Box plugin image_advanced not showing up on frontend
I'm using the Meta Box plugin on a site and am having trouble with one of the meta boxes options. I've got it working fine in the backend, but when I use it in a page template all i get on the front ...
-1
votes
1
answer
341
views
Create A Metabox For A Custom Field
I add videos to my WordPress posts' video format by using custom fields. I was wondering if there is any way to create a meta box in post editor (like excerpt or something) for that specific custom ...
-1
votes
1
answer
972
views
How to Create a Repeatable Meta Box
I would like to know how to create repeatable meta-boxes like in this video: http://www.screenr.com/a17s [starts at around 40 seconds]. I saw an answer on how one creates a repeatable section within ...
-1
votes
1
answer
418
views
Using CMB2 Plugin to create text_date metabox (datepicker) How do I save multiple dates? [closed]
I currently have a metabox with a custom date field but I'm wondering how do I customize it to save multiple dates instead of just one? (I need it to function similar to the tags metabox)?
-1
votes
1
answer
44
views
CPT Template Option to Top
I edited the following core file because I was unable to make the change in my child theme. I need my CPT Template option to appear first in the Post Attributes -- Template drop down list. I made it ...
-1
votes
1
answer
106
views
How can i remove blank area caused by theme's post meta boxes?
I have a problem with my theme's post screen metaboxes.
When i add new portfolio items, there is some meta boxes which i dont need to use in my post screen. And if i leave them blank and publish the ...
-1
votes
1
answer
1k
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',
'...
-1
votes
1
answer
837
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
votes
1
answer
132
views
How do I allow Authors and Contributors to use the metabox
i add meta box for custom post type and all user no-admin cannot show it.
How can solved this ??
add_action( 'add_meta_boxes', 'comic_meta_box' );
function comic_meta_box() {
...
-1
votes
1
answer
2k
views
CSS styling not working in a custom metabox
I have some difficulies styling Meta Box content of a custom post. No CSS styling is applied. I made a really simple testbased on what I have read on the other post here.
metabox creation:
...
-1
votes
1
answer
252
views
Need help, Passing variables with get_post_meta
$slider_image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'slider');
$slider_thumb = wp_get_attachment_image_src( get_post_thumbnail_id( $post->...
-1
votes
1
answer
73
views
Remove action of an external plugin after checking if custom post meta is set
Edit:The problem were 2 folds - somehow the order list I found before indicated wp_head was before wp_enqueue_scripts but that is not the case. Found another more updated one and it is actually right ...
-1
votes
1
answer
489
views
How we insert values into database using metabox Wordpress?
function Review_Form(){
?>
<form action="" method="post">
<div class="container">
<h1>Add Review</h1>
<hr>
<label for=&...
-1
votes
2
answers
25
views
Show search for data extracted from metabox
In custom post type book I have several books published
I just want to show data obtained from metabox field but I have not been able to help me the code that I am showing does not work
<?php $...
-1
votes
1
answer
540
views
Use a Variable in update_post_meta as the $meta_key
looking at the example on wordpress.org
update_post_meta( $post_id, $meta_key, $meta_value, $prev_value );
I seem to be having a problem replacing $meta_key with a variable. here is my code
...
-1
votes
1
answer
912
views
display all registered meta boxes
i want to display the list of all the meta boxes of each post. the global variable wp_meta_boxes would not print anything on the screen. how can i print the value of the array to get the list of all ...
-1
votes
1
answer
2k
views
Input select option Change Content in Metabox
I'm making a "Input select option" in Custom Metabox for my plugin, I'm not Expert in PHP I don;t know How to Save user "Input select option". Working perfectly plain PHP.
public function ...
-1
votes
1
answer
415
views
send meta box input data without publish button
I want to add meta-box in my plugin but i want add two inputs and one button like submit button when i click on submit button then input fields data send to database and received but how this is ...
-1
votes
1
answer
421
views
Datepicker altField and altFormat to save a new meta key/value in a post?
I've created a new metabox for Woocommerce products using the Meta Box plugin that takes in an event date using Datepicker.
I'm using the st-event_start_date metadata to show the date on a grid ...
-1
votes
1
answer
962
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", "...
-1
votes
1
answer
112
views
Display div based on Group metabox selection [closed]
I am having an issue with the below code when it comes to displaying a div based on a specific metabox is filled in. I am using the Group metabox selection from CMB2 to handle my metaboxes. As of ...
-1
votes
1
answer
144
views
Issues on saving data from CPT select metabox
I can't save data from a select metabox. My code is
http://pastebin.com/BMmKzti2
Where I'm going wrong?
Edit:
Here is my code
function fichasvtmbasicas_meta_box_callback( $post ) {
...
-1
votes
2
answers
794
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 ...
-1
votes
2
answers
1k
views
Conditonally check if Custom Meta Box has input
I currently display a URL from a custom meta box, but wanted to add a conditional check, so that if nothing has been entered, not to display the link text.
<a target="_blank" href="<?php $...
-1
votes
1
answer
424
views
Decimal stripped from metabox number
I am working on a Wordpress website for a client to show several property listings and their associated prices. When I enter the number in the metabox created by the developer it strips out all ...
-2
votes
1
answer
1k
views
Dynamic background image used in css after selector
.about-img:after {
background-image: url(../img/tola.jpeg);
}
How to dynamic above code in WordPress?
It's not only background image but used in css after selector.
-2
votes
1
answer
1k
views
How to change data format in custom meta box field [closed]
I want to chage date format to d-m-y means day-month-year format . I have added
'date_format' => __( 'd-m-Y', 'cmb2' )
But not working. now it's month-day-year formated . Actually i want to ...
-2
votes
1
answer
104
views
metabox displaying on incorrect page
I've got two different functions that output different metabox's one is for the pages and the other is for just the post.
For some reason the one I created for posts overwrites the one on pages and ...
-2
votes
1
answer
289
views
Canot save post if any meta box was empty
I need to dont save new post from custom post type if any meta box empty.
So we must check the meta if empty, we mus show me
" You must fill all meta box value before save post"
else if all meta ...
-2
votes
2
answers
429
views
iframe not showing on frontend when using a CMB2 field
I have a custom field manually coded using CMB2: https://cmb2.io/.
Here is the code:
$cmb_pages_customtext->add_field( array(
'name' => esc_html__( 'Content', 'defaulttheme' ),
...