All Questions
2,682 questions
0
votes
0
answers
22
views
Publish box in CPT remove 'edit' link
Hello I have a custom post and in the Publish Box I would like to remove the timestamp edit link.
0
votes
2
answers
67
views
Have mu-plugin remove meta box ONLY if it isn't already removed in functions.php
I have a mu-plugin that removes a branded "Welcome to X" dashboard meta box placed there by the hosting company I work for. It works fine mostly.
However, some of our agency clients are ...
1
vote
1
answer
62
views
Changing custom type name hides the posts [closed]
I created a custom post type. Plugin used is Custom Post Types & Custom Taxonomies plugin which does the job very good.
And added some posts to it.
But when I modify the name of the newly created ...
0
votes
0
answers
42
views
Query multiple post types, but different order for each
I have a query which searches 2 post types as below:
$args = array(
'post_type' => ['post', 'promotion'],
'posts_per_page' => 12,
'paged' => $...
0
votes
1
answer
80
views
How using the Meta Box plugin, to filter posts by the value of a post type field?
I'm using the Meta Box plugin to create custom post types and fields. There is a record type teachers, and I'm trying to display the lessons associated with him on the page of a certain teacher. The ...
0
votes
0
answers
52
views
Metaboxes inside Tab
I am learning WordPress Plugin development. In this regard I have to save some settings along with Custom Post in Admin Panel under a Menu. Can I place metaboxes inside tab for this issue like the ...
0
votes
0
answers
59
views
How can I query for posts using a date stored in post-meta?
I’m working on a games release feature for a website I’m building. So far everything is going smooth, but I’m stuck on one area. For the listings on the front end, I want it to look at the “...
0
votes
1
answer
444
views
How to cache the results of a query and display the cached results
I have a website centered around music. I have 3 main post types- 'Artist', 'Release', and 'Version'. There are 4 types of 'Version'- album, single, video, misc.
Artist is parent of Release. (artist ...
0
votes
1
answer
215
views
How to set up hierarchical relationships without using plugins / meta query
I'm running a large database of musical artists and their releases. I inherited the site after it running for a long time. There are currently several different custom post types, created with a ...
0
votes
0
answers
153
views
Why is $_POST empty when saving custom Meta Box?
I'm creating a Meta Box in my custom Plugin where the Administrator can select which users can view a certain post based on their roles. When I select the role and save the meta box content by ...
0
votes
0
answers
240
views
How to add date_query to meta_query array
I am building a meta query array and all fields for the user are optional so some might not have any data. But there is also an option which requires a date query. I am still checking to see if this ...
0
votes
2
answers
658
views
Order by the first array within a meta_query
I would like to sort the output of my WP Query. I want the events that are coming up soon to be at the beginning. The events that have already taken place should be at the end. So the first array in ...
0
votes
1
answer
694
views
Finding the screen id of a page generated with add_menu_page
I'm at a basic level of WordPress + PHP and I'm trying to build a pretty simple plugin.
I've set up the plugin correctly, and the plugin page is generated with
function wpplugin_settings_page() {
...
1
vote
1
answer
787
views
Display post in order of ACF checkbox?
I have a custom post type called ‘Skateboards’. Within the custom post type of ‘Skateboards’ , I added three checkboxes (filed type checkbox) with a field name of ‘skateboard_performance’ associated ...
0
votes
1
answer
75
views
order the meta query results by 2 custom fields
I have a custom post type 'brewery', I want to fetch results by 2 custom fields. The desired result is to get all posts with highest review rating (value is in decimal like 4.2 or 4.8) and if few ...
0
votes
1
answer
114
views
Isn't Returning Value While Using SELECT COUNT(*) FROM {$wpdb->prefix}
I'm trying to count rows in sql table using SELECT COUNT(*) for the post view count. My code is
function get_post_views($offset=0, $post_id){
global $wpdb;
$get_visit_query = "...
0
votes
2
answers
1k
views
How to sort WooCommerce products page by latest in-stock items first?
How to sort the WooCommerce products page by latest in-stock items first and all the out-of-stock items to the last?
Currently, I'm using a code snippet from "https://www.businessbloomer.com/...
0
votes
1
answer
2k
views
WP Query ordering on a meta field for posts with a date in the future not ordering by datetime
I have a WP Query:
$args = array(
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => 5,
'category__in' => $postCategories,
'meta_query' => array(
array(
...
0
votes
1
answer
399
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
24
views
Get other posts sharing the same meta values
I want to get all posts having the same meta values.
My Post A has 2 meta values: ID 182 and ID 183
I want to have all post having meta 182 or 183, excepting the current one of course.
I have tried:
$...
1
vote
1
answer
575
views
Send email button in custom post type backend
I've added a button in the backend of my custom post type editor.
I want to send an email using wp_mail() when admin user click a button.
I've added this custom form and button to a meta box. See ...
1
vote
0
answers
44
views
Overwrite YoastSEO meta-tags with another page's [closed]
I'm writing a custom Wordpress theme and for a specific page I need to overwrite its meta-tags (printed by YoastSEO) with the meta-tags of another page I already know the ID of. I cannot just change ...
1
vote
1
answer
339
views
Save / Show multi line text in metabox
In a plugin I have made (Snup Widget) I have made a metabox.
In the sample here I have made two line with text.
When I want to show the text in output in the widget it shows in one line, without break....
0
votes
1
answer
315
views
Custom Meta box change size
I a plugin that I have made (SNUP Widget) there is a strange error.
When I use widescreen monitor this custom meta box I made looks ok.
But with I open browser on my PC with split screen that is not ...
0
votes
0
answers
29
views
Creating a query that get all posts but places meta items first
I have a query that gets jobs based on a category. Some of these jobs are "featured" issue is the old system used a "featured" meta key, the new system uses "job_featured"...
0
votes
0
answers
250
views
Delete all posts with a specific custom field using meta_query
I'm building a listings website using WooCommerce.
A listing is either set to live or sold inside of a custom field key status
Once a listing is sold then the custom field status is updated with sold. ...
0
votes
0
answers
113
views
Fetch custom post related to a User
I am trying to fetch custom post related to a User. I am using below code.
$args = array(
'post_type' => 'tasks',
'meta_query' => array(
'relation' ...
0
votes
2
answers
151
views
Fetch all data of Users
I am trying to fetch users All information by using below code.
if($_POST['orga_id']) {
$users_query = new WP_User_Query(array(
'meta_query' => array(
'relation' ...
0
votes
1
answer
176
views
Use meta_query in args for relationship
I found this guide and I'm following it:
https://rudrastyh.com/wordpress/meta_query.html
But I see that it doesn't work for relationship of Advanced Custom Field. Why?
This is my code:
$args=array(
...
0
votes
1
answer
23
views
How to pull all the contributer users records and order by Designation (which is users meta data)?
I want to show all the contributors by the Designation. Following code is only pull the records and order by ID But I need to data order by Designation:
function contributors() {
global $wpdb;
$...
0
votes
1
answer
1k
views
ACF: How to get users with a ACF flexible content subfield with a specific value AND layout?
I am looking for a way to query users based on a user meta entry for an advanced custom field which has a given value and itself is from a given layout type.
For example, let's say I have the ...
1
vote
1
answer
21
views
Display no post when metavalue is 0
There is a page displaying the 3 most popular posts, using the post views on the query. When there are no post views, I don't want to display any posts.
How can I display no post when post_views_count ...
0
votes
1
answer
51
views
Custom Post Meta from custom metaboxes is randomly being deleted
For a while now I've been applying and updating some custom metaboxes that my company re-uses on different sites. (Not the same metaboxes, but the same methodology.)
Essentially it allows for the '...
0
votes
0
answers
440
views
Query on meta values and post title
I need some help with my search function.
What I want is a search function that search on the post title and on my meta values.
The meta values works but how can I add the post title to this query?
&...
0
votes
1
answer
190
views
ACF: How to query for a given value count of an array like field? (e.g.: How many rows has a `flexible_content` field?)
How can I write a WordPress meta query that gives me an array of users/posts that have a given amount of entries in a custom field that stores multiple values?
Something like SQL COUNT(), but for the ...
0
votes
1
answer
214
views
How do I echo all users' display_name and their meta_value who have a certain meta_key?
I have a meta_key inside the table usermeta called 'sms_subscriber'. The meta_value for it is their phone number. I want to echo a list of all users who have that field; in other words, a list of each ...
0
votes
0
answers
73
views
Combine query in WP_User_Query()
I am new user of WP_User_Query(). I don't know how to express whole situation. If I use below code I am getting good result.
$users = new WP_User_Query(array(
'meta_query' => array(
...
0
votes
0
answers
186
views
WP_List_Table Inside Metabox With Bulk Actions Not Working on Submit
I'm trying to display a WP_List_table inside a metabox. The metabox is for questions which are from assessment_question custom post type.The metabox is being displayed on an other custom post type '...
0
votes
1
answer
26
views
How to insert data into meta box from another plugin?
I have two different plugins. My custom-post-type is on the first plugin and it has some meta boxes. Now in the second plugin, I extracted the email using IMAP and stored it in the post type of the ...
0
votes
2
answers
102
views
Negative meta_query if storing multiple post_meta values with shared meta_key
WordPress supports storing multiple post meta values for a single post using the same meta key. For example one post can have multiple instances of meta_key 'pet' with meta_value 'cat', 'dog', and/or '...
1
vote
0
answers
108
views
Save Meta when custom Taxonomy Saves
I am in need of some advice, we are setting up a custom tag for Movies. We want to have it pull from the OMDB Api when it is saved. We have the function setup, but it is not firing, and I am stumped.
...
1
vote
1
answer
386
views
WP_User_Query ignoring 'meta_query' arguments
So, I'm trying to do a query on 'members' based on some inputs from a form using AJAX.
The thing is that when searching for a 'role' I get the expected result. But once I try to look for other meta ...
0
votes
1
answer
78
views
how to prevent added meta box from being injected with style="position: fixed; top: 56px;" at scroll down
This is my first attempt to customize WordPress.
I added a meta box like this
function settings_metabox() {
//register custom meta box
add_meta_box("mybox-id", "Settings", &...
0
votes
1
answer
71
views
get posts based on non-single metadata
I have meta data to custom post "event", registered as non-single, i.e., there is an array od metadata "terms" (it is not WordPress term, I just call it term, it is a record ...
1
vote
1
answer
36
views
can i fetch a custom metabox data in another page or post type?
I need to fitch a metabox field data in another page ,
$headabouttitle1 = get_post_meta(get_the_id(), 'head_title1', true);
this is how i fetch it in the same page , I need to fitch it in another ...
0
votes
1
answer
442
views
Saving a Custom Post Type with a Meta Box results in a "Updating Failed" error
I have a Custom Post Type (Favourites) which I plan on using to talk about my favourite craft products. The meta box field I want to have is a link to an online store listing, so users can buy the ...
0
votes
0
answers
136
views
Multiple nested meta queries
This has been driving me nuts for days so if anyone can provide any sort of solution that would be lifesaving.
I have a form that is querying posts (WP_Query), depending on the meta data.
Form fields ...
1
vote
1
answer
435
views
Wp_query function to search from product_title 'OR' product tags name
I am looking to show search results from either product title or product tag name. I have implemented the product title search through the below code, but I need to add tag name search also into it. ...
0
votes
0
answers
25
views
how to update post content field in wordpress
i have used add meta boxes to customize page content and use wp_update_post to save it.
when im creating new page in wordpress it inserts two new record in wp_posts table.
one of them has published ...
0
votes
1
answer
595
views
How to _GET multiple value checkbox WP_Query in Custom Toxonomy / Custom Fields
I try to make a sort of fiter for my website. Goal is for the visitors to query results by prices ('prix') and hobbies ('aimerparlapersonne').
Prices are numbers between min and max. Hobbies is ...