WordPress.org

Ready to get started?Download WordPress

Forums

get the conent not showing pictures (14 posts)

  1. emaarkhan
    Member
    Posted 1 year ago #

    Hello..
    I m working in a loop and i need to make the thumbnails appear next to content but its not happening

    <?php
    			$content = get_the_content();
    			echo substr($content, 0, 200);
    			?>
  2. IMICreation
    Member
    Posted 1 year ago #

    try exceeding the character limit with 2000 because 200 is too short to get image

  3. emaarkhan
    Member
    Posted 1 year ago #

    That worked.thanks! but how can i make the thumbnail small?

  4. IMICreation
    Member
    Posted 1 year ago #

    you can mention your desired size in dashboard - setting - media and than select your size image at the time of upload

  5. emaarkhan
    Member
    Posted 1 year ago #

    I might want it big in main post the small here. so anyway for that?

  6. IMICreation
    Member
    Posted 1 year ago #

    for that purpose you have to select featured image

  7. emaarkhan
    Member
    Posted 1 year ago #

    but how do i apply that small part to the code above?

  8. emaarkhan
    Member
    Posted 1 year ago #

    i want to class the img class. but its outputting it from get_the_content. how can i do that

  9. IMICreation
    Member
    Posted 1 year ago #

    if you want to show two different size image you can only use featured image

  10. emaarkhan
    Member
    Posted 1 year ago #

    I tried that but it doesn't show. :/

  11. Krishna
    Volunteer Moderator
    Posted 1 year ago #

    Can you post a URL to illustrate the problem?

  12. IMICreation
    Member
    Posted 1 year ago #

    are you trying the_post_thumbnail();
    for that you have to insert featured image
    is there any text also with yout image or you want to show only image if you want to get only image than the best way is to use featured image

  13. emaarkhan
    Member
    Posted 1 year ago #

    I have this page, which runs a loop on parent and its child. and displays all the child, with 500 char of the content along with title and picture. now the picture maybe large in real post but i want it small or thumbnail size of the page which i created, so they look pretty. As for now, the image size inside the post is being shown on the page
    p.s - that code in taken from research collectively. i am learning!

  14. Maneetpuri
    Member
    Posted 1 year ago #

    You can add a css class to the image and define that class inline in loop.php.

    <img class="tim" src="website-url/wp-content/uploads/2012/08/driveway.jpg" alt="" />

    <style type="text/css">
    .tim { width:50px;height:50px;}
    </style>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags