Get all attachment by post excluding featured and content inside

I have solved. The solution is related with the function get_post_meta(); As WordPress as made by the abstraction of differnet kind of posts with the same structure we can define different post types. Here we can find more information about the function: https://developer.wordpress.org/reference/functions/get_post_meta/ And as you can read, you can find 3 vars $post_id, $key … Read more

Get ALT attribute from title post (code not work)

Well, changing get_post( $post_ID )->post_title to get_the_title($page->ID) won’t work, because the variable $page isn’t defined anywhere in your function… If you’ll take a look at add_attachment hook, then you’ll see that it takes only one parameter: $post_ID – (int) Attachment ID. So you don’t have the ID of post that it’s attached to. And to … Read more