Home › Forums › Support › Insert a wp_show_post in each post This topic has 14 replies, 3 voices, and was last updated 3 years, 9 months ago by David. Viewing 15 posts - 1 through 15 (of 15 total) Author Posts July 9, 2020 at 1:53 am #1357540 Stephane Hello Do you know how to insert at the end of each posts: [wp_show_posts id=”20502″] <p><!– Using the Simple List –></p> Regards, Stef July 9, 2020 at 3:31 am #1357643 DavidStaff Customer Support Hi there, you can add shortcodes to a Hook Element: https://docs.generatepress.com/article/hooks-element-overview/ The after_main_content hook places it below the posts content. You can see hook positions here: https://docs.generatepress.com/article/hooks-visual-guide/ July 9, 2020 at 4:35 am #1357721 Stephane Hi david, Thx. It works. Do you know how to display like this? (title on the image). Currently, it appears like this In the hook, I’ve inserted : <?php if ( function_exists( 'wpsp_display' ) ) wpsp_display( 20502 ); ?> Regards Stef July 9, 2020 at 4:44 am #1357730 DavidStaff Customer Support With the Dispatch site you need to wrap your code like so: <div class="wpsp-card"> <!-- add your function here --> </div> July 9, 2020 at 4:58 am #1357758 Stephane Nothing display with: <hr > <?php if ( function_exists( ‘wpsp_display’ ) ) wpsp_display( 20502 ); ?> July 9, 2020 at 6:54 am #1357877 DavidStaff Customer Support Try this code – making sure your WPSP lists ID is 20502 <div class="wpsp-card"> <?php if ( function_exists( 'wpsp_display' ) ) wpsp_display( 20502 ); ?> </div> July 9, 2020 at 8:12 am #1358095 Stephane The ID is ok. It works with <div> <?php if ( function_exists( 'wpsp_display' ) ) wpsp_display( 20502 ); ?> </div> but not with the class <div class="wpsp-card"> <?php if ( function_exists( 'wpsp_display' ) ) wpsp_display( 20502 ); ?> </div> July 9, 2020 at 8:26 am #1358114 DavidStaff Customer Support Can you disable autoptimize July 9, 2020 at 8:35 am #1358127 Stephane I tried without results July 9, 2020 at 8:50 am #1358147 Stephane It works with the default wp_show_posts: <div class="wpsp-card">[wp_show_posts name="Simple"]</div> <p><!-- Using the Simple List --></p> I’m going to use it. July 9, 2020 at 8:51 am #1358148 DavidStaff Customer Support Yeah – i don’t think it likes the function. Shortcode is good 🙂 July 9, 2020 at 9:07 am #1358173 Stephane In fact, even if I used the default [wp_show_posts name=”Simple”], it doesn’t work well. 1. Ok with category, no display with post_tag 2. I select the last posts (date > descending) in the category, but it displays other results. July 9, 2020 at 2:02 pm #1358401 TomLead Developer Lead Developer Hi there, Can you explain a bit more about what isn’t working, exactly? The card styles, or something about the posts being queried? July 10, 2020 at 1:55 am #1358758 Stephane Hi Tom, In fact, I think the mistake was mine. It’s all right. Thanks for your help Stef July 10, 2020 at 12:26 pm #1359466 DavidStaff Customer Support Glad to hear you got it working! Author Posts Viewing 15 posts - 1 through 15 (of 15 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In