Related Posts by Taxonomy icon
Content & Editing

Related Posts by Taxonomy hooks reference

  • By keesiemeijer
  • v2.7.10
  • Updated

Related Posts by Taxonomy 2.7.10 has 1 actions and 44 filters, read directly from its source code on Nov 17, 2026. The list updates automatically when a new version is released.

How to use these hooks

Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.

functions.phpyour child theme
// Run your own code when Related Posts by Taxonomy fires an action
add_action( 'related_posts_by_taxonomy_after_display', function( $type ) {
	// Your code runs here.
}, 10, 1 );

// Change a value Related Posts by Taxonomy is about to use
add_filter( 'related_posts_by_taxonomy', function( $posts, $post_id, $taxonomies, $query_args ) {
	// Change $posts here.
	return $posts;
}, 10, 4 );

Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.

All hooks

  • includes/template-tags.php line 68
    /**
     * Filter CSS classes used in related posts display templates.
     */
    apply_filters( 'related_posts_by_taxonomy_post_class', $classes, $post, $args, $index );
  • includes/template-tags.php line 167
    /**
     * Filter related post link HTML.
     */
    apply_filters( 'related_posts_by_taxonomy_post_link', $link, $post, $link_attr, $args );
  • includes/gallery.php line 504
    /**
     * Filter the gallery image link.
     */
    apply_filters( 'related_posts_by_taxonomy_post_thumbnail_link', $image_link, $image_attr, $related, $args );
  • includes/gallery.php line 142
    /**
     * Filter the related post gallery image in the feed.
     */
    apply_filters( 'related_posts_by_taxonomy_rss_post_thumbnail_link', $image_link, $related, $args );
  • the_title

    filter
    includes/gallery.php line 129 · used in 3 places
    apply_filters( 'the_title', esc_attr( $related->post_title ), $related->ID );
  • the_excerpt

    filter
    includes/gallery.php line 579
    apply_filters( 'the_excerpt', get_the_excerpt() );
  • widget_title

    filter
    includes/class-widget.php line 127
    apply_filters( 'widget_title', $args['title'], $args, $this->id_base );

Generated from Related Posts by Taxonomy's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.

Can't find the right hook?

We can build the customisation for you. Describe what you need: