Tag Info

New answers tagged

7

We will hook into init and remove actions as followed: function disable_wp_emojicons() { // all actions related to emojis remove_action( 'admin_print_styles', 'print_emoji_styles' ); remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); remove_action( ...


0

Thanks for raising this issue, it interests me as well. After searching everywhere for an acceptable solution, this is how I approach the problem on my site, at least for now: comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => '25' ))) If you change '25' to, say, '1000', this will give you pretty much 'infinite replies', ...


1

You are almost close. add_filter( 'some_custom_filter', array( $this, 'filter_suppress_the_content' ), 10, 3 ); // the above line states that, the method `filter_suppress_the_content` should have three arguments, where you have used nothing. public function filter_suppress_the_content() { return true; } // comparing your code, this method should have ...


0

i think the best way to alter images is through css. you add a class to all your pictures that would set its size into your custom size. I think bootstrap has that feature


4

You can use the category__in argument: // use get_the_category( $post_id ) if you are outside the loop $categories = get_the_category(); if( $categories ){ $related_posts = get_posts( array( 'category__in' => $categories ) ); }


0

Here is example: add_action('pre_get_posts','search_filterr');function search_filterr($query) { if ( !is_admin() && $query->is_main_query() ) { if ( $query->is_search ) { $query->set('post_type', array('post','custom-posttt-too') ); $query->set('category__in', 999 ); <------ ...


0

I figured it out. It looks as if the Codex never referenced the one parameter I needed to make it work in the Codex. I checked out this site here for a full list of parameters in the arrays http://www.billerickson.net/code/wp_query-arguments/ I needed to use post_parent and not child_of or parent. Fixed.


0

Just use the $product parameter to get the custom field value, and determine what to return: function custom_price_html( $price, $product ) { if ( ( int ) get_post_meta( $product->id, 'price_per_person', true ) ) $price .= ' per person'; elseif ( ( int ) get_post_meta( $product->id, 'price_per_group', true ) ) $price .= ' per ...


0

The recommended best practice is to use a mu-plugin for this. Adding add_filter()s to wp-config.php directly can cause all kinds of other problems and conflicts.


0

The author key/value query won't work. Try modifying the query by moving the query out of the meta query like so: array( 'author' => $author, 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'leads_status', 'value' => '-1', ), array( 'key' => ...


0

It's actually used by WP to allow plugin developers change WP behavior. You can make your code flexible using do_action so other plugin/theme developers or simply yourself can change behavior of your code. For example imagine you have a WP loop in a theme framework. You would like to add breadcrumb at the top of it, here is the simplest method: ... ...


0

Your plugin code is going to run before the theme code and hence will run before anything is added to the hook. You will need to the code that processes the file inclusion to some other hook that runs after all of the plugins load, like after_setup_theme This should help: Is there a flowchart for wordpress loading sequence?


2

The thing with class methods is that unless they're static, they belong to an object. And in your case your object is: new WC_Admin_Taxonomies_new(); Which means PHP will create the object and keep it in memory. But unfortunately, since you're not assigning this object to a variable, you have no way of referencing it later in your code. Off the top of my ...


1

If I understand you correctly you're not looking for the wp_search_stopwords filter type of solution. So here's a modification of the great answer by @kaiser that you referred to: /** * Exclude array of words from all search queries in the front-end * * Modification of http://wordpress.stackexchange.com/a/41100/26350 by @kaiser */ add_filter( ...


0

I think these should be separate taxonomies. Category is actually a taxonomy in its own right. You would create a taxonomy for each of the filters/drop-downs. This may seem like overkill but i think it will make it easier to work on additional features down the road. Add the following method to your functions.php. Replace 'rwc' with your theme's domain: ...


0

Another way that @toscho's solution made me try, and worked for me, is this scheme: http://example.com/videos/?tag=crazy


0

If you have done the first part correctly in loop-home.php, you can just simply move that into the appropriate template used by your archive pages. Taken into account that you have not used custom queries to build your queries on the homepage or any of the archive pages, you can do the following which will work on any of the aforementioned pages Use the ...



Top 50 recent answers are included