• I’m trying to create my own personal theme just for learning.

    If I understand correctly the the_content grabs all content from a post; text, images and media files, right?

    And right out of the box I can target the title with .entry-header and the rest of the content with .entry-content.

    But how can I upload images to a post while separate them from the content in the .entry-content

    I can only seem to find the info post_thumbnail, how can I “target” image attachments. I would like to know what function to call in the post type template file to create a separate div for a image gallery etc.

    Sorry if it is badly written, I’ve just started out and reading through the documentation. All the terms and names are still knew to me. I did my best though.

    Thanks.

    I’m using the _underscores starter theme…

Viewing 1 replies (of 1 total)
  • Hello,

    You can take all post images like this:
    $media = get_attached_media( 'image' );

    Find out more about get_attached_media function on Codex

Viewing 1 replies (of 1 total)
  • The topic ‘Grab images from post?’ is closed to new replies.