Forum Replies Created
-
AuthorPosts
-
Connor
ParticipantAwesome, thanks, Tom!
Connor
ParticipantAwesome, thanks Tom! I’m glad I’m not going crazy! Should it be possible to exclude both the current post and my own selected exclusions once this is fixed?
Connor
ParticipantYes, 3401 is the current post. I do have a number of other custom functions added through Snippets, but none of them are related to WP Show Posts.
Connor
ParticipantHi Tom,
Here’s what is showing with “Exclude current” unchecked and post 3595 listed to be excluded:
array(8) { ["order"]=> string(4) "desc" ["orderby"]=> string(4) "date" ["post_type"]=> string(4) "post" ["posts_per_page"]=> int(3) ["ignore_sticky_posts"]=> bool(true) ["post_status"]=> array(1) { [0]=> string(7) "publish" } ["tax_query"]=> array(1) { [0]=> array(4) { ["taxonomy"]=> string(8) "category" ["field"]=> string(4) "slug" ["terms"]=> array(1) { [0]=> string(6) "saving" } ["operator"]=> string(2) "IN" } } ["post__not_in"]=> array(1) { [0]=> int(3401) } }
Connor
ParticipantOddly, even when I uncheck that option, it is still excluding the current post and not the one I have specified.
Connor
ParticipantHey Tom,
I have confirmed this is the list that is hooked in below the post content, so I don’t think that’s the issue. 3401 is the current post which it is excluding (per the checkbox in the “More” settings). However, it doesn’t seem to be excluding post-ID 3595 as well.
Connor
ParticipantIt’s showing the following
array(8) { ["order"]=> string(4) "desc" ["orderby"]=> string(4) "date" ["post_type"]=> string(4) "post" ["posts_per_page"]=> int(3) ["ignore_sticky_posts"]=> bool(true) ["post_status"]=> array(1) { [0]=> string(7) "publish" } ["tax_query"]=> array(1) { [0]=> array(4) { ["taxonomy"]=> string(8) "category" ["field"]=> string(4) "slug" ["terms"]=> array(1) { [0]=> string(6) "saving" } ["operator"]=> string(2) "IN" } } ["post__not_in"]=> array(1) { [0]=> int(3401) } }
Connor
ParticipantHi Tom,
1. This shortcode works perfectly, thank you!
2.Yes, Under WP Show Posts -> Selected List -> More Settings I have entered “3595” in the Exclude Post IDs field. For an example if where this shouldn’t be displaying, if you go to this post (https://afterschoolfinance.com/live-below-your-means/), the first post at the bottom where WP Show Posts displays is Christmas on a Budget. This is post 3595, which I have tried to exclude because it is seasonal.
Thanks!
Connor
ParticipantHi there!
I was able to get the category next to the date with the built-in option. To remove the link from the date I added:
add_filter( 'wpsp_date_output', 'tu_wpsp_updated_date_first' ); function tu_wpsp_updated_date_first() { $time_string = ''; $time_string .= '<time class="wp-show-posts-entry-date published" datetime="%1$s" itemprop="datePublished">%2$s</time>'; $time_string = sprintf( $time_string, esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( 'c' ) ), esc_html( get_the_modified_date() ) ); // If our date is enabled, show it $output = sprintf( '<span class="wp-show-posts-posted-on wp-show-posts-meta"> %1$s </span>', $time_string ); return $output; }
This does work (though I am not sure if the PHP is done right, as I was copying code from the forum and then modifying to take out the modified date part.
Thanks!
-
AuthorPosts