Home › Forums › Pro Support › Post order
Tagged: Posts sort, shortcode change
- This topic has 32 replies, 4 voices, and was last updated 3 years, 6 months ago by
Tom.
-
AuthorPosts
-
June 13, 2019 at 3:41 pm #9855
Tom
KeymasterThe latest version of GP Premium (1.8.3) fixed the issue with Sections. It should remain in the “Text” tab now, so it won’t convert the character.
June 19, 2019 at 12:50 am #9932Rolandas
ParticipantThank you.
Everything works greatJune 19, 2019 at 4:29 pm #9946Tom
KeymasterAwesome 🙂
December 5, 2019 at 3:27 am #12214Daniel
ParticipantI’m replying to this thread because I’m having a similar issue. When I enter the following WPSP shortcode into a Gutenberg shortcode block, it works. The problem: the next time I edit the page with that shortcode, Worpdress/Gutenberg converts/escapes the ampersands from “&” to “&”
[wp_show_posts id=”33309″ settings=”meta_key=priority&orderby=meta_value&order=ASC”]
I can circumvent the issue by entering the shortcode directly into editor as a text block. I’d prefer not to do this, since managing a page is easier/cleaner when its shortcodes are in shortcode blocks.
Note: I’m not using GP “sections” — only GP and WP Show Posts.
Any thoughts?
December 9, 2019 at 9:11 pm #12291Tom
KeymasterJust to confirm, this is happening in the Gutenberg shortcode block?
December 10, 2019 at 1:04 am #12298Daniel
ParticipantYes, all the behavior I describe happens in the editor, in the Gutenberg shortcode block.
December 13, 2019 at 6:15 pm #12320Tom
KeymasterHmm good to know, we may need to come up with an alternative to
&
in a future version.Thanks!
December 14, 2019 at 4:12 am #12333Daniel
ParticipantSure thing, Tom. Please keep me posted. Ideally, there’s a solution that does not break existing WP Show Post shortcodes being used.
And also, just for clarification (since the ampersand code is converted to the symbol in this comment window), here are images.
What appears upon attempting to re-edit the page:
Thanks also for your continued work on GP and this plugin,
DanDecember 16, 2019 at 7:17 pm #12360Tom
KeymasterThanks for that – I’ll see if we can use
|
as a separating character as well.May 14, 2020 at 1:22 am #15568Greg
ParticipantSorry for digging up an old thread, but I’m having the same issue as Daniel’s post above – happening with both a shortcode block and just a Custom HTML block, when the page is saved it’s fine – but whenever the edit page is opened again the & character has added ‘amp;’ afterwards – any ideas on a fix for this?
Thanks
GregMay 14, 2020 at 8:23 pm #15586Tom
KeymasterUnfortunately there is no way around this at the moment.
May 15, 2020 at 8:09 am #15592Greg
ParticipantHi Tom,
That’s a shame, do you know of any other way I can sort posts by both Category and Tag, or even multiple Tags (so that it only shows posts which meet all tags rather than any single one selected)?
Thanks for the help
GregMay 15, 2020 at 5:09 pm #15603Tom
KeymasterKind of silly, but you could build a “wrapper” shortcode:
add_action( 'my-posts-shortcode', function() { ob_start(); $settings = array( 'meta_key' => 'priority', 'orderby' => 'meta_value', 'order' => 'ASC', ); wpsp_display( 123, $settings ); return ob_get_clean(); } );
Then you could add this to your block:
[my-posts-shortcode]
May 16, 2020 at 4:20 am #15612Greg
ParticipantHi Tom
I tried this but it just showed the text name for the shortcode on the front end – I also tried ‘wp_show_posts id=my_posts_shortcode’ which didn’t work either.
Would you be able to give me an example for creating a snippet shortcode that pulls posts in via a specific category name/ID and tag name/ID if that’s possible?
Thanks
GregMay 16, 2020 at 4:47 am #15614Greg
ParticipantJust found a solution to this via a reply you had helped someone with on another thread, I changed my setting so that the list selects the category and then the shortcode setting filters by tag, eg:
[wp_show_posts id="123" settings="taxonomy=post_tag&tax_term=tag-name-here"]
Seems to be working!
Thanks, Greg -
AuthorPosts
- You must be logged in to reply to this topic.