WordPress.org

Ready to get started?Download WordPress

Forums

No image (32 posts)

  1. gugaraj
    Member
    Posted 2 years ago #

    I changed many themes but images for post is not appearing in homepage .wot to do ? pls help

    [No bumping. If it's that urgent, consider hiring someone.]

  2. peredur
    Member
    Posted 2 years ago #

    A link to your site would help us to see what's going on. In particular, it would help us to see if your image is found by your server.

    Another possibility is that your theme uses the_excerpt() for displaying posts on the home page. If that's the case, all images are stripped out of the display.

    Cheers

    PAE

  3. gugaraj
    Member
    Posted 2 years ago #

    here is the site , btw those images are link only not in server .no problem in single post page , but in home page its not showing image

  4. peredur
    Member
    Posted 2 years ago #

    Looks to me as though you've got a 'more' break after the first sentence (and before the "requirements"). So you don't see anything beyond, "GRave Defense HDv1.9.0" on your first post.

    You also have what looks as though it's meant to be a short code, saying [break] just after the image. It's being treated as text, though, and not as any kind of a break.

    Your other posts are similar, although they don't show the "[break]" string.

    I notice on your second post that the line or paragraph break before "Requirements" is not there, so this suggests to me that your theme is using the_excerpt() and not the_content(). If I'm right, it means that the HTML is being stripped of things like images. See the Codex entry and read the first paragraph carefully.

    Your images are on a server, btw, just not on *your* server :-)

    HTH

    PAE

  5. gugaraj
    Member
    Posted 2 years ago #

    iam bit confused bro , where to add "the_content()" ? pls clear me bro :(

  6. peredur
    Member
    Posted 2 years ago #

    Depends on your theme. You need to find where your theme implements the WordPress Loop. For example, in twentyeleven, it's in content.php. In twentyten it's in loop.php. I usually start in index.php and look for what's being called in there, and follow the trail along until I find the loop.

    Once you've found the right file, you need to check to see if I'm correct and that your theme is using the_excerpt(). If it is, you'll want to replace the_excerpt() with the_content(), with the correct parameters, of course.

    When you've done that, you'll find that the entire contents of all your posts will appear in place of the teasers that you currently have. If you want to not have the entire content on your blog page, you need to edit your posts and put "More" breaks in at the places where you want the teaser to end. You do that on the Edit Post page in the Dashboard, using the Visual editor (click on the "More" break button with the insert cursor at the point where you want the break to occur).

    If your theme is not using the_excerpt(), we'll have to think again.

    Cheers

    PAE

  7. peredur
    Member
    Posted 2 years ago #

    If you're using the 'protect' theme, which looks likely from the code I can see, then the index.php file calls a function called the_post_excerpt() which is a function in the theme's own functions.php file. This function either gets or creates an excerpt. It's called like this:

    <?php the_post_excerpt($excerpt_length=50); ?>

    I'm not sure what will happen if you replace it with the_content(), but you could try it. Just comment the line above out, and add the following immediately after the closing of the comment:

    <?php the_content(); ?>

    ... and we'll see what happens.

    If it completely messes everything up beyond what a bit of CSS and the use of some "More" tags can fix, you can just delete the added call to the_content() and uncomment the call to the_post_excerpt(...).

    Cheers

    PAE

  8. gugaraj
    Member
    Posted 2 years ago #

    where to add this bro "<?php the_content(); ?>" in index.php ? (i am not pro in wp ,sorry for noob like Q)

  9. peredur
    Member
    Posted 2 years ago #

    If the suggestions I gave in my last post aren't enough for you, the question would be, are you confident that you can mess about with PHP files and deal with the consequences if things go wrong? I'm not suggesting you shouldn't try, but you need to be happy you can fix things if they fall over.

    But, assuming you are happy and that you're using the 'protect' theme, you simply do as I said before. You look for the existing call(s) to get_the_post_excerpt(...) and replace them with call(s) to the_content() in (from what I can see) index.php.

    You need to take all the usual precautions, like having backups, especially of the index.php file, commenting out the old code rather than removing it, making all your changes in a Child Theme and so on. The standard stuff that developers do to minimise the risk that they're going to break something. Remember, I didn't write this theme. I just downloaded it and took a quick look, so it could be doing something quite unexpected that I haven't picked up on. We'll never know until we try.

    You also need to be prepared to do some fairly serious reformatting of the output: firstly by using 'More' tags in your posts, but also some amount of CSS work because what's being output from the_content() is likely to be quite a bit different from the current output.

    If you're not using the 'protect' theme then if you let me know what theme you are using I'll take a look to see if I can see where the excerpt is being obtained.

    For people who are not comfortable messing around with HTML/CSS/PHP it's probably best to stick with what the theme offers in the way of configuration. Either that or do some serious study in th field. It's not hard to learn, but it does take some effort.

    HTH

    PAE

  10. gugaraj
    Member
    Posted 2 years ago #

    thx for your great kindness bro ,pls edit for me if you has time , say which php file sud i give .

  11. peredur
    Member
    Posted 2 years ago #

    Well, I've already said it twice, but, "Tri chynnig i Gymro" as we say in this part of the world (three tries for a Welshman).

    If you're using the 'protect' theme you need to edit the theme's index.php file.

    If you're not using the 'protect' theme, please post what theme you are using and I'll try to find out what you need to do in that one.

    Cheers

    PAE

  12. gugaraj
    Member
    Posted 2 years ago #

    OMG you are the man . Now its showing image bro but the image size is too small .pls say the way to make it big bro .

  13. peredur
    Member
    Posted 2 years ago #

    The img tag specifies a width of 100px.

    Is this an image you've added to the article in the Post editor, or is it a "Featured Image"?

    This article (scroll to the end) explains how to set the size of a featured image.

    If it's just an image you inserted into your post, edit your post, hover over the image and then click on the 'edit' icon. In the resulting dialog select the appropriate size: probably 'full size' if you've uploaded an image of the size you require, which is always the sensible thing to do in order to avoid the browser having to waste time resizing the image.

    HTH

    PAE

  14. gugaraj
    Member
    Posted 2 years ago #

    bro its ok in post but in homepage its small (its not featured image)

  15. peredur
    Member
    Posted 2 years ago #

    Then something is setting the width to 100px.

    Your theme calls the_post_thumbnail(), so you could try replacing the first parameter with the string 'full', like this:

    the_post_thumbnail('full', array('class' => 'alignleft')

    No idea if it'll work, but you can try it.

    Cheers

    PAE

  16. gugaraj
    Member
    Posted 2 years ago #

    no bro its giving error , pls find any way bro :)

  17. peredur
    Member
    Posted 2 years ago #

    Well, your guess is as good as mine, really. You've got to be prepared to just keep on trying things until you find something that works.

    What error did you get?

    I guess you could try getting rid of the call to the_post_thumbnail() altogether. Worth a try, I suppose. Make sure you just comment it out rather than deleting it so you can put it back later.

    Have you checked the properties you set up when you inserted the image into your post? What properties did you set?

    Cheers

    PAE

  18. gugaraj
    Member
    Posted 2 years ago #

    normally i copy image from other source bro ,

    & here the image setting
    http://i.imgur.com/yxV7b.jpg

  19. peredur
    Member
    Posted 2 years ago #

    Don't know what your first sentence means.

    For the image configurations, I mean the image settings that you chose when you inserted the image into your post. To see what they are, edit your post, hover over the image and click on the configuration icon that appears. The dialog that then gets displayed shows you the settings you chose. You can change them of you want. They include things like the image size, whether it is floated and so on.

    Cheers

    PAE

  20. gugaraj
    Member
    Posted 2 years ago #

    this is the detail bro

    http://i.imgur.com/iJjFh.jpg

    but i think its only for inside post image , but for homepage thumbnail size bro ? :(

  21. peredur
    Member
    Posted 2 years ago #

    No idea.

    As I say, you can try getting rid of the call to the_post_thumbnail(), but I've no idea if it'll work.

    You never told me what error message you got.

    Cheers

    PAE

  22. gugaraj
    Member
    Posted 2 years ago #

    oops i cant find the_post_thumbnail() bro , a m i missing any bro ?

  23. peredur
    Member
    Posted 2 years ago #

    It's in index.php, just above where the_post_excerpt() was before you replaced it with the_content()

    Cheers

    PAE

  24. gugaraj
    Member
    Posted 2 years ago #

    i am getting "Parse error: syntax error, unexpected ';' in /home/mobisdkc/public_html/wp-content/themes/protect/index.php on line 31"

  25. peredur
    Member
    Posted 2 years ago #

    What's on line 31 of that file? Post some context, like lines 30 to 33 if you can.

    Cheers

    PAE

  26. gugaraj
    Member
    Posted 2 years ago #

  27. peredur
    Member
    Posted 2 years ago #

    It obviously doesn't like the semicolon. Try putting a space between the semicolon and the '?>'. If that doesn't work, try deleting it - but leave the space.

    I'd also try commenting out lines 30 - 32 inclusive to see what you get.

    cheers

    PAE

  28. gugaraj
    Member
    Posted 2 years ago #

    http://i.imgur.com/W50Ki.jpg

    same error bro

    (sorry for late reply bcoz iam not well )

  29. peredur
    Member
    Posted 2 years ago #

    You're missing a closing parenthesis. You should have:

    <?php the_post_thumbnail('full', array('class' => 'alignleft')); ?>

    Try that, and if it doesn't work try commenting out lines 30 - 32 inclusive and see what happens.

    Cheers

    PAE

  30. gugaraj
    Member
    Posted 2 years ago #

    pls chk site bro ,horizontal images are ok , but still vertical images are small bro .

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags