Site logo

Archived topic

Two post lists - what to use; WP Show Posts or GP dynamic content features...?

17 replies · Started by Peter on July 16, 2021

Viewing posts 1–15 of 18

Hi,

So, for a client we are building a news-site.

In the header-section (using GP Pro) the client wants the latest post (based on the date it's published) from a specific category - i.e. News category

Just below the header section the client wants a listing of the rest of the posts from the same News category - EXCEPT the latest post which being displayed in the header-section.

Can this be done using GP Pro, WP Show Posts, GP dynamic content or what not?

Hope I am making sense... :-)

Thanks.

P.

Hi there,

the 'easiset' method is to have a static front page and use the WP Show Posts plugin to create the various lists for featured posts, followed by a section of X latest posts or categoriezed posts.

Thats how the Dispatch and Read sites work in the Site Library.

Hi David,
After testing out both Dispatch and Read themes, I am not sure I quite understand your reply.

Can I use WP Show Posts to create two lists loading posts from the same category, where the second list leaves out the ones displayed in the first list?

I know this is a kinda weird question, but that's how my client wants it...

Thank you!

P.

Hi Peter,

Can I use WP Show Posts to create two lists loading posts from the same category, where the second list leaves out the ones displayed in the first list?

I know this is a kinda weird question, but that’s how my client wants it…

On WPSP, it's possible by changing the query on WPSP's edit page. It's on the post tab where you can see dropdowns for post type and taxonomy. You can also change the query on the shortcode as well.

Example/s:

WPSP list that will show posts from the category "birds"
[wp_show_posts id="1234" settings="taxonomy=category&tax_term=birds"]

WPSP list that will show posts from the category "cats"
[wp_show_posts id="1234" settings="taxonomy=category&tax_term=cats"]

WPSP list that will show posts from the category "dogs"
[wp_show_posts id="1234" settings="taxonomy=category&tax_term=dogs"]

You can place all of these in 1 page if you like, effectively showing multiple post lists. :D

Hi,
When I use this syntax in a page, it works when I save, but when I edit the page, the shortcode parameter settings have &.

I use the shortcode block when saving the page (i tried also with custom html)
[wp_show_posts id="1234" settings="taxonomy=category&tax_term=birds"]

As soon as I edit it, it appears with & (if i save the wp show post do not work)
[wp_show_posts id="1234" settings="taxonomy=category<strong>&</strong>tax_term=birds"]

How can i resole this issue?

Thank you

Can you try disabling all plugins except GP Premium & WPSP? And try to deactivating any active child theme as well.

Something seems to be escaping shortcode characters. It's strange that it's making the ampersand bold.

Here's a workaround for that - https://wordpress.org/support/topic/problem-with-gutenberg-escaping-shortcode-attributes/#post-14658065

But it's better to find the root cause on why that happens in the first place. That's not how default WordPress works and it's not something caused by the theme as well as it doesn't happen on all WordPress + GP installation. :D

Sorry there's no bold but a & amp; , thank you i will follow up shortly

I use the shortcode block when saving the page (i tried also with custom html)
[wp_show_posts id="1234" settings="taxonomy=category&tax_term=birds"]

As soon as I edit it, it appears with & (if i save the wp show post do not work)
[wp_show_posts id="1234" settings="taxonomy=category& amp;tax_term=birds"]

@Elvin, I have deactivated plugins and active child theme and it is still not working. I am working with the German edition of WordPress, it may be the issue. I will use you workaround.

Thank you

Yes it's being escaped. You'll probably get > and < for & gt; and & lt; as well.

It's likely a snippet or a plugin it's causing this, similar to the user's issue on the link I've provided on my previous reply. :D

You'll have to debug the site by disabling/enabling plugins one by one to find which one is causing this.

I'm guessing it's a security plugin but other plugins or PHP snippets from child themes can cause this as well.

The quick and easy solution is the workaround I've provided.

I did disabling everything, I just started building the web, only 4 plugins added on top of GeneratePress/Blocks Family. thank you

Hi there,

can you try adding a Classic Block and add the shortcode inside that.

Hi David, when using a classic block the settings are ignored, indeed the & is not transformed to amp;.

Hmmm... i know there are some issues with the Block editor but the escaping of text in the shortcode was something i thought they had fixed.

Before we bash our heads together on this issue, can i revert back to the original question.

Will this requirement be on the default category archives ?

Let me get back to you with a video (bow) thank you

OK :)

This archived topic is closed to new replies.