Override plugin with functions.php

You can change the name of add_gpp_gallery function both in the callback and in the declaration to avoid the conflict between the original and your clone. Something like this… add_action(‘wp_head’,’jason_add_gpp_gallery’); function jason_add_gpp_gallery() { if ( is_single() && ‘your_post_type’ == get_post_type() ) ){ remove_shortcode(‘gallery’, ‘gallery_shortcode’); add_shortcode(‘gallery’, ‘gpp_gallery_shortcode’); } } … should work for you. Bonus: You … Read more

Generating rel=prev and rel=next only on wordpress categories

Not entirely sure if I agree with the explanation of your SEO guy as rel=prev and rel=next are used for paginated archives. Of course categories can be one, but also your blog if it’d contain multiple pages. Anyways, here’s what I’m currently using: remove_action( ‘wp_head’, ‘adjacent_posts_rel_link_wp_head’ ); add_action( ‘wp_head’, ‘cor_rel_next_prev_pagination’ ); /** * Pagination with … Read more

Where to place custom functions?

Organize your code by its purpose: If it creates output on the front end and requires changes in your theme’s style sheet – it belongs to the theme. You don’t have to put everything into the functions.php, split he code into several files if it helps. For example like this: // extra functions just for … Read more

How do I edit wp_head and/or functions.php to remove rss-feed which isnt used and dont validate?

If we look at the file /wp-includes/default-filters.php we can find these two lines in there add_action( ‘wp_head’, ‘feed_links’, 2 ); add_action( ‘wp_head’, ‘feed_links_extra’, 3 ); so if we want to remove these actions, we can do it with these two lines in functions.php: remove_action(‘wp_head’,’feed_links’,2); remove_action(‘wp_head’,’feed_links_extra’,3); So the feed links will be removed from the <head> … Read more

How to access function from outside of a class within this class in WP plugin?

Create a static getter for your class instance: class DD_Awesome_Plugin { /** * Plugin main instance. * * @type object */ protected static $instance = NULL; /** * Access plugin instance. You can create further instances by calling * the constructor directly. * * @wp-hook wp_loaded * @return object T5_Spam_Block */ public static function get_instance() … Read more