[Support request] Attachment

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Attachment

Tagged: ,

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #20693
    Carin
    Participant

    In the sales-video för PRO version it shows Attachement as Post-type. I don’t have it and that was the reson I choose to by this. How do I choose to show attachments (or Media-files?) as Post-type?
    I want link to files for download, for example a .pdf that is uploaded to the media library and in different categories

    #20849
    Tom
    Keymaster

    Hi there,

    We had some issues with the attachment post type as an option in WPSP in the past.

    You should be able to bypass that like this:

    [wp_show_posts id="123" settings="post_type=attachment"]

    Let us know 🙂

    #20867
    Carin
    Participant

    Thanks Tom! I’m only using short codes on this website so this will not work for me I assume?

    #20927
    Tom
    Keymaster

    The above is a shortcode, you just need to add the settings part to your existing shortcode 🙂

    #20987
    Carin
    Participant

    HI! It did not work. Could it be that its Media-files and not attachments to any posts?

    #21117
    Tom
    Keymaster

    The files in the Media Library are posts in the attachment post type.

    Does your list display anything at all?

    #21119
    Carin
    Participant

    No I get the message “no posts to show” (the no result text)

    #21121
    Carin
    Participant

    Using category sorting to get the list I want. (And on that I choose “posts” because attachment isn’t in the list)

    #21173
    Tom
    Keymaster

    We may need to debug the query:

    We can debug the query to see what WordPress is requesting from the server.

    1. Update to 1.2.0: https://wpshowposts.com/wp-show-posts-1-2-0/

    2. Add this function:

    add_filter( 'wpsp_query_args', function( $args, $settings ) {
        if ( 123 === (int) $settings['list_id'] ) {
            var_dump($args);
        }
    
        return $args;
    }, 10, 2 );

    If you update the 123 with your list ID, it should output some data above the list.

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