Browsing Category

Wordpress filters

pre_get_posts query between 2 dates (date stored in custom post meta)

I have a custom post type with posts which have a custom field of date. On the posts list (edit.php) I want to be able

Query total number of posts

Using a search filter plugin. I am using to get the total number of posts that exist in the database $wp_query->found_posts However, when a user

wp_get_attachment_image_attributes not working for me

I’ve distilled this example down to its most basic functionality on my local site and it still has no effect, no matter which attribute I

How to filter a query by date in a shortcode?

I’ve written a shortcode for fetching the most viewed posts in the past week. I use a filter as the following in my shortcode’s function:

comment_for() Custom fields not visible when user is logged in

i have added some custom form fields using comment_for() as well as filtering the comment_form_default_fields and comment_form_defaults hook for the purposes of using a custom

(Woocommerce) Order by price when entering specific category

is there a way to order products by price only when a user enters to a specific category? I kind of know that i can

Add a class to the anchor tag on HTML5 gallery

I want to add a class to the anchor tag of the HTML5 gallery, so I can use a lightbox plugin, but I do not

Applying $posts_clauses filter to specific queries only

I use this code for some kind of sorting but it brakes some theme parts, like “Last articles” in footer, and content part after products.

How to make the <!–nextpage–> show as a button?

So currently my blog post has a “Pages: Next page” at the bottom of my blog post by putting in the editor where I wanted

Why is wordpress removing some unicode characters (e.g. some emojis) when I save my post?

Try making a new post, pasting this string of emojis: “🐻🐝🐦🐈🐔🐄🦀🐕🐬🐘🐟🐸🐐🐎🐒🐼🐖🐑🐟🐢🐳” and then saving that post as a draft. When I do this (in WP

Adding meta and tax queries with pre_get_posts generates SQL error

In the WordPress admin, I am trying to filter the display of a custom post type based on a meta value as well as a

Single_template for a custom post type created from a plugin is returning an empty page

I’m trying to create a single template for the custom post type posts called ‘press release’ from a plugin. This is the code I added

How to disable a plugin for certain page?

I tried this (inserted into the function.php): if( is_page( 799 ) ) { remove_action( 'plugins_loaded', 'bj_lazy_load' ); } Not working… Read more here: How to

How correctly use filter term_link with sitemap.xml for product category in Woocommerce?

For change url for some product categories i use this function: add_filter( 'term_link', array( $this, 'replace_term_link' ), 9000, 2); function replace_term_link ( $termlink, $term )

the_excerpt filter with an empty excerpt

How do I adjust the post excerpt when the excerpt itself is blank / empty? I looked and the code for the the_excerpt filter tests

views_edit-post filter not working (custom post type)

I have a custom post type, and on the main admin edit list screen I would like to add a filter (in addition to All,

Back to Top 145132 wordpress questions, 32 Wordpress answers.
Wordpress related, All rights reserved
Powered by Creative Advertising