Site logo

Archived topic

Insert a wp_show_post in each post

14 replies · Started by Stephane on July 9, 2020

Viewing posts 1–15 of 15

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

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

With the Dispatch site you need to wrap your code like so:

<div class="wpsp-card">
<!-- add your function here -->
</div>

Nothing display with:
<hr >

<?php if ( function_exists( 'wpsp_display' ) ) wpsp_display( 20502 ); ?>

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>

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>

Can you disable autoptimize

I tried without results

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.

Yeah - i don't think it likes the function. Shortcode is good :)

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.

Hi there,

Can you explain a bit more about what isn't working, exactly? The card styles, or something about the posts being queried?

Hi Tom,

In fact, I think the mistake was mine. It's all right.

Thanks for your help

Stef

Glad to hear you got it working!

This archived topic is closed to new replies.