Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Bill Erickson

    (@billerickson)

    You will need to use the ‘display_posts_shortcode_output’ filter to modify what is output for each item. See this line in the plugin: https://github.com/billerickson/display-posts-shortcode/blob/master/display-posts-shortcode.php#L288

    Thread Starter jfarr07

    (@jfarr07)

    Thanks Bill! I will look at doing this.. What I entered currently in my functions.php was this… but I’m not the greatest with PHP so I’m not sure if its fully correct code wise but it does seem to work.

    add_filter( 'display_posts_shortcode_output', 'format_dps_outer', 10, 7 );
    function format_dps_outer( $output, $atts, $image, $title, $date, $excerpt, $inner_wrapper, $wrapper) {
    
    	// Make Outer Wrapper
    	$wrapper = ' <div>'. $wrapper .'<div>';
    
    	// Now let's rebuild the output.
    	$output = '<div class="customportfolio">' . '<' . $inner_wrapper . ' class="listing-item">' . $image . $title . $date . $excerpt . '</' . $inner_wrapper . '>' . '</div>';
    
    	// Finally we'll return the modified output
    	return $output;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Wrap class "listing-item"’ is closed to new replies.