• o4tuna

    (@o4tuna)


    I would like to get away from using the_content() in my single.php because it seems you can’t get the featured image out of the return and do anything with it. I need to put the image in its own div to resize it.

    What functions can I use to get the post’s content (text, title, meta, featured image) in separate “things” such as one might do with a WP_Query?

    Thanks

Viewing 1 replies (of 1 total)
  • Michael

    (@alchymyth)

    there is no direct function to deliver the txt and images of a content separately.

    get the post’s content (text, title, meta, featured image) in separate “things”

    – text (but this does include any inserted images etc): get_the_content();
    – title: get_the_title();
    – meta: there is no general function; you need to get the date, author, etc with separate functions;
    – featured image: get_the_post_thumbnail();

    please use web search to get more detailed information about the individual functions, for example search with the keywords: ‘wordpress codex {function_name}()’

Viewing 1 replies (of 1 total)
  • The topic ‘Single post, what to use instead of the_content()?’ is closed to new replies.