Home › Forums › Pro Support › Post order
Tagged: Posts sort, shortcode change
- This topic has 32 replies, 4 voices, and was last updated 3 years ago by
Tom.
-
AuthorPosts
-
May 27, 2019 at 1:18 pm #9549
Rolandas
ParticipantHow do I get the posts in the order I want? I’m trying to put posts by post ID, but I can’t.
May 27, 2019 at 4:58 pm #9553Tom
KeymasterHi there,
You should be able to select ID using the Order By option in the “More Settings” tab.
Let me know 🙂
May 28, 2019 at 12:01 am #9557Rolandas
ParticipantHi Tom
1 example – https://www.sisla.lt/testas-1/
Page name: Testas 1_ 79,69,81,89
WP Show Post Shortcode: [wp_show_posts id=”1342″]
Post type: post
Taxonomy: category
Terms: selectet one category “atlyginimas-ir-skatinimas”
Post IDs: 79,69,81,89
Order: Ascending
Order by: ID2 example – https://www.sisla.lt/testas-2/
Page name: Testas 2_ 81,89,79,69
WP Show Post Shortcode: [wp_show_posts id=”1351″]
Post type: post
Taxonomy: category
Terms: selectet one category “atlyginimas-ir-skatinimas” (
Post IDs: 81,89,79,69 !!! other post order than in example 1
Order: Ascending
Order by: IDIn both cases, posts are shown by their ID order, Not in the order I set
10 post – 69
15 post – 79
16 post – 81
20 post – 89What else have I missed, what setting?
May 28, 2019 at 4:19 pm #9568Tom
KeymasterInteresting – what if you remove the specific post IDs? Do they sort by order then?
May 29, 2019 at 1:26 pm #9586Rolandas
ParticipantThank you.
I did as you posted. Posts sort by IDs correctly. I misunderstood at first how it works.
I’ll refine the question:
Is it possible to make posts according to a specific custom order?
And how to do it?
I found this https://wpshowposts.com/support/topic/sort-by-custom-field-value/#post-7803 but I don’t know (I don’t understand) what I can do with it.May 29, 2019 at 3:46 pm #9592Tom
KeymasterThat method uses a custom field which you need to add to each post.
Alternatively, you can try a plugin like this: https://wordpress.org/plugins/post-types-order/
May 30, 2019 at 12:34 pm #9605Rolandas
ParticipantThank you.
I will use the custom field. I understood where to add the additional code.May 30, 2019 at 4:14 pm #9614Tom
KeymasterAwesome 🙂
June 2, 2019 at 1:34 am #9662Rolandas
ParticipantHi
I suddenly found that it doesn’t work when:
1. GP Premium 2.2.2 (2.3-alpha.2) – on page are using sections;
or
2. on page is used other WPSP shortcode;
3. switching a page from text editing to visual editingJune 2, 2019 at 7:49 am #9668Rolandas
ParticipantLooks like I found the one cause of inaction (when post is not sorted by custom order)
Look,
Shortcode somehow is change
Shortcode before:
[wp_show_posts id="1606" settings="meta_key=as_eiles_nr&orderby=meta_value_num&order=ASC"]
Shortcode after:
[wp_show_posts id="1606" settings="meta_key=as_eiles_nr&orderby=meta_value_num&order=ASC"]
The length has changed
2 times added “amp;”.This happens using sections (and cannot be changed)
also editing page in visual mode
and for some other reasonJune 2, 2019 at 8:12 am #9669Rolandas
ParticipantCorrection (If I write as a code, it corrects “amp;”)
Shortcode after:
wp_show_posts id=”1606″ settings=”meta_key=as_eiles_nr&orderby=meta_value_num&order=ASC”June 4, 2019 at 3:25 pm #9726Tom
KeymasterWhere is this happening, exactly? Inside a GeneratePress Section?
June 5, 2019 at 12:54 am #9741Rolandas
ParticipantIn shortcode “&” is replaced to “&”
I have found 2 different cases.
1. Page (without GP sections mode)
When the editor mode is switched from Text to Visual and back to Text.
You can then correct the shortcode in Text Mode and everything works.I use only Classic Editor (with plugin “Classic Editor”).
Settings: Default editor for all users: Classic Editor;
Allow users to switch editors: No.2. Page (with GP section mode)
I created a GP section. I’ve inserted a shortcode. Saving.
Then I open the section content in Text Mode (GP section content opens in Visual Mode by default) and see that the shortcode is changed.
You can’t correct the shortcode in Text Mode. After correction and section saving, shortcode anyway is changing.June 9, 2019 at 11:05 am #9806Tom
KeymasterIt’s a bug in Sections right now that the “Text” tab isn’t remembered like in the Classic Editor. If you shoot us an email, we have a patch available for testing which should fix that: https://generatepress.com/contact
June 9, 2019 at 1:16 pm #9811Rolandas
ParticipantSorry, but I didn’t understand what I have to do.
-
AuthorPosts
- You must be logged in to reply to this topic.