How can i filter wordpress users by custom feild?

I'm displaying users (authors) on a page. how can I add a filter based on user custom feilds? <?php // THE USER QUERY ARGS $args = [ 'role' => 'author', 'number' => -1, ]; // THE USER QUERY $user_query = new WP_User_Query($args); // THE TOTAL SUBSCRIBERS NUMBER echo '<h3 class="font-weight-bold">Total Listed Shops: ' . $user_query->get_total() . '</h3>'; echo '<hr>'; // THE USER LOOP if (!empty($user_query->get_results())) { foreach ($user_query->get_results() as $user) { // ACF PREFIX & FIELD DATA FROM USER PROFILE …
Category: Web

How to get a category in a list item class

I am need to know how would I get the category to be dynamically input in a WP_Query This is the code I am using: <li class="<?php the_category(' ')?>"> but the output is breaking. This is all the code <ul id="portfolio-list"> <?php $args = array( 'post_type' => 'post', 'post__and' => array( 15, 14, 17, 13, 10, 8, 12, 11, 9, 16), ); $the_query = new WP_Query( $args ); ?> <?php if ( $the_query->have_posts() ) :?> <?php while ( $the_query->have_posts() ) …
Category: Web

Wrap Meta Box with <li> and </li> for each new line

I'm trying to automate one of our posting aspects. We post a lot of lyrics and have a system of meta boxes which we use to input various pieces of information about each set of lyrics we post. One aspect that is a little annoying is having to search &amp; replace &lt;li&gt;&lt;/li&gt;tags to the start and end of each new line of lyrics. I was hoping to have PHP echo this automatically but my code is not working at the …
Category: Web

How to get all wp_posts in wordpress fetched from database

I have downloaded a theme and installed it. Here the theme has custom fields for limited numbers. For ex. author_name, comments but, I want all the wp_posts to be displayed. And prior to that, actually I have a database associated with this. So basically I want my piece of code to read the whole database and represent it in columns in my wordpress page. For ex. author_name, ping_status, post_status etc. So basically I want to write a function, that can …
Category: Web

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() { // Register default widgetized areas $sidebars = array( 'primary' =&gt; array( 'name' =&gt; __( 'Primary Widget Area', WMW_ADMIN_TEXTDOMAIN ), 'desc' =&gt; __( 'The primary widget area', WMW_ADMIN_TEXTDOMAIN ) ), 'home' =&gt; array( 'name' =&gt; __( 'Homepage Widget Area', WMW_ADMIN_TEXTDOMAIN ), 'desc' =&gt; __( 'The homepage widget area', WMW_ADMIN_TEXTDOMAIN ) …
Category: Web

display the months of a specific category

I have a website made in wordpress, this website has a file called category-intranet.php that is responsible for showing me all the posts of the category &quot;Intranet&quot;. what I need is that when the visitor reaches this point, on one side you see all the posts of the category &quot;intranet&quot; and on the other a kind of sidebar that shows the months ONLY of the category &quot;Intranet&quot;. I tried with get_month_link(), but this shows all the months of all posts …
Category: Web

How to add product tag to order list

Hello, how can I add in the column, the tags of the products corresponding to the order please, the tag column which is painted in yellow, I saw that it was possible to put the name of the products but it is more complicated to put the product tags? Thanks for your help
Category: Web

Best way to insert a list of links into a post outside of the_content

I would like to have a list of links to PDFs on some posts that sit outside of the main content. See wireframe: The links need to be editable via the editor / wp admin and be post-specific. It's a custom template so I have full access to the &quot;single.php&quot; template. Because I need to be able to edit the link text for each link, I don't think I can use custom fields as there is no way to match …
Category: Web

Return all Tags and Categories in Separate List

I am using the snippet below to create a shortcode to get all tags for a search in a separate list including tag count. Eg search for 'foo' and it returns all tags for all posts that match the search 'foo'. I am trying to also get the categories from the same search in a separate list using a second shortcode from the same global search. I am not sure how I can get the categories from the same global …
Category: Web

Return All Tags from Search Result in Separate List

I am trying to create a list of tags on top of my search results page that returns all tags and tag count for all tags that are included in the search results. For example, I search for 'Foo' and it returns 100 posts all with different tags eg pizza, bred, tomatoes. I would like all the tags with tag count (tag count related to search result) related to my search to show on top of my search results page …
Category: Web

Live search in admin page

I'm building a plugin that works only in admin. I've a page where the user choose some posts, the script generate a pdf file from this data and then it save in a specif folder. To help the user to choose the posts I would to do an input text with a &quot;live search&quot;. The user select the post from the list result and the script add it in a list (and the post_id in a hidden input). I've searched …
Category: Web

How do you obtain a list of all image file names on a wordpress website for replacement?

Good Day, I hope somebody can assist me please. I have to replace/re-upload all the images on a website, as they were uploaded as massive files. I have to downsize all the images, and want to know if there is a way to get a list of file names so that I can downsize the images and replace them, without editing every image one at a time. The source images on the website are 1920x1080, and I need to re-upload …
Category: Web

wp_dropdown_categories and custom taxonomy + custom post type

I have created custom post type called &quot;case study&quot;(with slug case-study), with support of custom taxonomy which is called &quot;theme&quot;. What i am trying to achieve? Simple dropdown, with redirect to specific taxonomy term page on option select. The code: &lt;form id=&quot;category-select&quot; class=&quot;category-select&quot; action=&quot;&lt;?php bloginfo('url'); ?&gt;&quot; method=&quot;get&quot;&gt; &lt;?php $args = array( 'show_option_all' =&gt; __( 'Choose theme', 'l-p' ), 'hide_empty' =&gt; 0, 'echo' =&gt; 0, 'show_count' =&gt; 0, 'taxonomy' =&gt; 'theme', ); $select = wp_dropdown_categories( $args ); $replace = &quot;&lt;select$1 onchange='return …
Category: Web

Get children of taxonomies

$terms = get_terms([ 'taxonomy' =&gt; array('Movies, Musics, Books, Games'), 'parent' =&gt; 0, 'depth'=&gt; 2, 'hide_empty' =&gt; false, ]); $sorted_terms = []; if ( $terms ) { foreach ( $terms as $term ) { $sorted_term = [ 'WP_Term' =&gt; $term, // the global term 'icon' =&gt; get_field( 'logo', $term-&gt;taxonomy . '_' . $term-&gt;term_id ), 'srating' =&gt; get_field( 'rating', $term-&gt;taxonomy . '_' . $term-&gt;term_id ), 'carrentActiveClass' =&gt; '', 'count' =&gt; (int) wpse340250_term_count( $term, 'sikayet' ), // everything you will need later here …
Category: Web

Can I wrap an unordered list inside a shortcode?

So, I created an events page for my client that holds lots of details about events. We found no particular event plugins to be helpful for their purpose, so I built a a custom template using advanced custom fields. They are very computer illiterate and will need to be entering these events in very frequently. I used a few shortcodes from my theme to create the layout for these pages. Now I want to take basically make the page super …
Category: Web

Exclude a category from the filed under list only on some templates

this is a follow up question to this post Exclude a category from the filed under list The solution given works for me. However, I'm curious how I can get this to work conditionally? Specifically, only on category archives? E.g. It will still say &quot;Filed Under: A, B, X&quot; on single post templates. But it will say &quot;Filed Under: A, B&quot; on archives. Working in Genesis, if that helps.
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.