Hi, it’s me again. I see your code for filtering the wrapper opening and close. However I need to get the category variable into the opening. What is the best way to accomplish what I want without hacking your plugin?
Below is my hack to your line 149, the results of which provide a link to the category page of the category that was specified in the shortcode
[display-posts category="Foo" posts_per_page="3"]and looks like this: Foo Headlines : More Foo
$open = apply_filters( 'display_posts_shortcode_wrapper_open', '<h2>' . $category . ' Headlines : <a href="' . get_category_link( get_cat_ID( $category ) ) . '">More ' . $category . '</a></h2><' . $wrapper . ' class="display-posts-listing">' );
- The topic ‘[Plugin: Display Posts Shortcode] use $category in opener without hacking plugin?’ is closed to new replies.