Viewing 1 replies (of 1 total)
  • Plugin Author keesiemeijer

    (@keesiemeijer)

    Hi Luca

    Consider creating a child theme instead of editing a theme directly — if you upgrade the theme all your modifications will be lost.

    To add the excerpt to the caption put this in your functions.php file:

    add_filter( 'related_posts_by_taxonomy_caption', 'rpbt_add_excerpt_to_caption', 10, 2 );
    
    function rpbt_add_excerpt_to_caption( $caption, $related ){
    	$caption =  trim( $caption );
    
    	$caption = $caption ? '<h4>' . $caption . '</h4>' : '';
    
    	global $post;
    	$post = $related;
    	setup_postdata( $related );
    
    	// get's the autogenerated excerpt or post execerpt if available
    	$excerpt = apply_filters( 'the_excerpt', get_the_excerpt() );
    	wp_reset_postdata();
    
        $caption .= $excerpt ? $excerpt : '';
        return $caption;
    }

    To style the gallery see the selectors you can use here:
    https://keesiemeijer.wordpress.com/related-posts-by-taxonomy/post-thumbnails/#css-selectors

    To style the post title in the caption

    .related-gallery .gallery-caption h4 {
    
    }

    To style the excerpt in the caption

    .related-gallery .gallery-caption p {
    
    }

    I assume by site title you mean the widget or shortcode title.

    The widget title can be styled with this selector

    .widget.related_posts_by_taxonomy .widget-title {
    
    }

    The shortcode title with this:

    .rpbt_shortcode h3 {
    
    }

Viewing 1 replies (of 1 total)
  • The topic ‘Style adjustment’ is closed to new replies.