Closed vol4ikman closed 9 years ago
If you want to limit a attachments instance to a single page, the _attachmentslocation{myinstance} may help you:
function my_attachments_location_limit( $val )
{
global $post;
// the post ID is 13 and you only want this instance to show up there
return ( $post->ID == 13 ) ? true : false;
}
add_filter( 'attachments_location_my_attachments', 'my_attachments_location_limit' );
You can have your callback be as elaborate as you'd like, using any attributes WordPress has to offer at runtime.
Thank you @luandamasceno
Setup Attachments for specific page-template (like, template-about.php) ?
How can I do that?