Support » Plugin: WP Attachments » Manually adding to template

  • This is a great looking plugin but we want to control where the files are being added in our post layout by manually inserting the php code into the single post template. How do we stop the attachments from automatically being added to every post and manually add to the post template instead?

    https://wordpress.org/plugins/wp-attachments/

Viewing 7 replies - 1 through 7 (of 7 total)
  • We would like to exclude video files from appearing in the attachment list as well. Cheers 🙂

    Plugin Author Marco Milesi

    (@milmor)

    You can exclude the entire metabox, but at the moment the only way to exclude files is to unattach them to the content (not really suggested).

    Thank you for the feedback

    Ok just edit this lines in wp-better-attachments.php and you can call from the template using:

    wpatt_content_filter();

    Edit
    Line 73

    add_filter('the_content', 'wpatt_content_filter');
    
    function wpatt_content_filter($content)

    change for

    //add_filter('the_content', 'wpatt_content_filter');
    
    $content=get_the_content();
    function wpatt_content_filter()

    Line 195:

    $content .= apply_filters( 'wpatt_list_html', $content_l );

    change for

    $content =apply_filters( 'wpatt_list_html', $content_l );
    echo $content;

    Just created an account to say thank you for this.

    Solved a major issue for me 🙂

    This should totally be an added feature to the plugin to extend functionality.

    Shuld I use this if i want to add download in my sidebar widget?

    Can you please explain how to use wpatt_content_filter(); after i will do the changes to the plugin?

    Thanks!

    If we change the plugin, what happens when you update it ?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Manually adding to template’ is closed to new replies.