[Resolved] Post order

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Post order

This topic contains 17 replies, has 2 voices, and was last updated by  Tom 2 months ago.

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #9549

    Rolandas
    Participant

    How do I get the posts in the order I want? I’m trying to put posts by post ID, but I can’t.

    #9553

    Tom
    Keymaster

    Hi there,

    You should be able to select ID using the Order By option in the “More Settings” tab.

    Let me know 🙂

    #9557

    Rolandas
    Participant

    Hi 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: ID

    2 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: ID

    In 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 – 89

    What else have I missed, what setting?

    #9568

    Tom
    Keymaster

    Interesting – what if you remove the specific post IDs? Do they sort by order then?

    #9586

    Rolandas
    Participant

    Thank 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.

    #9592

    Tom
    Keymaster

    That 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/

    #9605

    Rolandas
    Participant

    Thank you.
    I will use the custom field. I understood where to add the additional code.

    #9614

    Tom
    Keymaster

    Awesome 🙂

    #9662

    Rolandas
    Participant

    Hi

    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 editing

    • This reply was modified 2 months, 3 weeks ago by  Rolandas.
    #9668

    Rolandas
    Participant

    Looks 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 reason

    #9669

    Rolandas
    Participant

    Correction (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”

    • This reply was modified 2 months, 3 weeks ago by  Rolandas.
    • This reply was modified 2 months, 3 weeks ago by  Rolandas.
    #9726

    Tom
    Keymaster

    Where is this happening, exactly? Inside a GeneratePress Section?

    #9741

    Rolandas
    Participant

    In 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.

    #9806

    Tom
    Keymaster

    It’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

    #9811

    Rolandas
    Participant

    Sorry, but I didn’t understand what I have to do.

Viewing 15 posts - 1 through 15 (of 18 total)

You must be logged in to reply to this topic.