We're merging with GenerateBlocks! Learn more here.

[Resolved] Shortcode

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Shortcode

Tagged: 

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #15089
    David
    Participant

    Hi,

    How do I use the shortcode so that I do not need to make a list for every category? for every tag?

    Is there a way to do [wp_show_posts id=”76440″ settings=”tag=humanities”]

    Thank you for your time?

    #15100
    Tom
    Keymaster

    Hi there,

    You can do exactly that.

    For example:

    [wp_show_posts id="76440" settings="taxonomy=post_tag&tax_term=humanities"]

    #15102
    David
    Participant

    Tom is now my best friend.

    #15107
    David
    Participant

    I use the Blog module for GeneratePress Premium and I wanna use the WP Show Posts for the sidebar posts. I can add the shortcode you wrote above into the widget. But how can I make it be aware of which category the blog post has?

    Could I use https://en-ca.wordpress.org/plugins/content-aware-sidebars/ with the shortcode above in sidebars?

    Thank you.

    #15143
    Tom
    Keymaster

    Hi David,

    It wouldn’t be possible to use the shortcode to fill the term dynamically. That would require PHP so we could communicate with WordPress on-the-fly to know which term is being viewed.

    Of course, you could use a plugin like Content Aware Sidebars to set up multiple instances of the shortcode and manually add the term name.

    #15152
    David
    Participant

    Tom,

    Actually, I choose https://wordpress.org/plugins/custom-sidebars/

    Add everything is working great.

    Before, using Content Views Pro, I had a 1.3 second delay (on average), for unused css on PageSpeed.

    Now using WP Show Post, and the built in features of GP Premium, I have only 0.15 second delay for unused css on PageSpeed.

    You now get (earn) $75 from me every year.

    Thank you for your hard work.

    #15177
    Tom
    Keymaster

    Awesome!

    Thank you! Really appreciate it 🙂

    #15263
    David
    Participant

    Hi Tom,

    How to do a shortcode to filter specific author:

    [wp_show_posts id=”76440″ settings=”user_id=35″]

    So that the grid only shows posts by that author.

    This is my question now.

    Thank you.

    #15306
    Tom
    Keymaster

    Hi there,

    It’s not possible in the shortcode, unfortunately.

    You’ll need to make this change to the core code (it will be in the next update): https://github.com/tomusborne/wp-show-posts/commit/286caf1164db8b6b6f38b85d3a011b519a27f4de

    Then you can do this:

    add_filter( 'wp_show_posts_shortcode_args', function( $args, $settings ) {
        if ( 76440 === $settings['list_id'] ) {
            $args['author'] = 123;
        }
    
        return $args;
    }, 10, 2 );
    #15324
    David
    Participant

    This sounds great. I’m looking forward to the update. Thank you so much for your great plugin and theme.

    #15329
    David
    Participant

    Actually here is the thing. I’m trying to redo the way WordPress does author webpages.

    1. Use Yoast to disable the /author/ archives pages.
    2. Each contributor writes a full-length professional bio as a post.
    3. Use GP Elements and WP Show Posts to include a list of the posts on 2.

    But WPSP does not allow to filter by author. And the shortcode doesn’t work either.

    But Like the list of posts that shows on the /author/ archive pages, if Yoast keeps them enabled.

    Can I somehow use the php code in a GP elements, without needing WPSP, because it seems that code I already written.

    Any ideas on the best route to take?

    David

    #15350
    Tom
    Keymaster

    So are you just trying to remove the /author/ part of the URL then?

    #15354
    David
    Participant

    No. Step 1 says I use Yoast to disable the author pages.

    Here is a short video made for you.

    Can WPSP help?

    Thank You.

    #15371
    Tom
    Keymaster

    Gotcha – sorry for the confusion!

    Try this:

    [wp_show_posts id="76440" settings="author=35"]

    #15377
    David
    Participant

    Yes Tom, this did it just as expected.

    My page speed score (98 mobile), download speed (<1s), and user experience have greatly improved since I switch to your theme and plugin.

    Thank you so much.

    David

Viewing 15 posts - 1 through 15 (of 18 total)
  • You must be logged in to reply to this topic.