Caption code displays

Viewing 15 posts - 1 through 15 (of 19 total)
  • #2073
    ChattahoocheeNow
    Participant

    Hi Daniel,

    I’m enjoying this theme as I learn more and more! It’s really the right display for my site.

    I have a problem where the “popular” column entries are showing the HTML for the caption next to a featured image. e.g.: “[caption id="attachment_402" align="alignnone" width="400" caption="LS"][/caption]

    But only there! Not when those same entries display under recent, or another category.

    My site is ChattahoocheeNow.org. You can see this in the second and third entries under Popular, about the trash day and about the billboards.

    Thanks for any help…
    Lisa

    #2074
    Daniel Tara
    Keymaster

    That is because that area displays the excerpt instead of the content and the excerpt strips html code.

    What you can do is move the caption after the first 18 words, so it doesn’t display on the front page at all.

    #2075
    ChattahoocheeNow
    Participant

    Thanks for the quick reply, Daniel!

    The caption, though, goes with the photo, and the photo goes at the top of the post in normal page display.

    So, do I need to upload the “featured photo” without a caption, separately?

    #2076
    ChattahoocheeNow
    Participant

    Actually – just tried removing the featured photo (only the featured photo – left it within the post), but the caption code still displays.

    #2077
    ChattahoocheeNow
    Participant

    Curious…. why does it happen on the “Popular” but not on the left-hand column, which I have modified to be a particular category?

    #2078
    Daniel Tara
    Keymaster

    It happens only in the posts where the caption code is at the beginning of the content, because only the first words of the content are shown in that section.

    #2079
    ChattahoocheeNow
    Participant

    Sorry to be thick-headed, but, I still don’t get it. πŸ™

    Are you saying that *any* caption on any story in the Popular column will show the code?

    The mystery to me is that the caption code appears only when the story is under the Popular heading. It does NOT appear, on the SAME stories, when they appear under Seen, Heard.

    You can view a screenshot of this happening here:
    http://chattahoocheenow.org/wp-content/uploads/2011/03/code-problem.png

    The Billboard story appeared in both columns, but only in the Popular column does the code show.

    #2080
    Daniel Tara
    Keymaster

    OK, here is where I think the problem lies:

    In functions.php find this line:

    $content = $topfive->post_content;

    Replace it with:

    $content = $topfive->post_excerpt;
    #2081
    ChattahoocheeNow
    Participant

    Thanks for investigating.

    When I do that, it [b]does [/b] get rid of the code.

    But then the items only display “Read more”…. No words excerpt at all.

    FYI, as a workaround, I had removed the caption completely from those two entries. To test this, I put the caption back onto one of the two stories (1 day, 18 sites…)

    also FYI, am going to put the original line back into functions.php for now

    #2082
    Daniel Tara
    Keymaster

    Ok, try this one:

    replace

    $content = $topfive->post_content;

    with:

    $mypost = get_post( $topfive->ID );
    $content = $mypost->post_excerpt;

    I’ll have to rewrite big portions of the theme’s code, because it’s a mess. This is one of the reasons an update has been delayed but expect one soon.

    #2083
    alloin
    Participant

    doesn’t work, I can fix this for u for a small fee πŸ˜‰

    #2084
    ChattahoocheeNow
    Participant

    Thank you for working so hard to fix it! I have not had time to try this yet but have it on my to=do list.

    Will be really glad to see an update. This is a great theme and I’m stickin’ with it!

    Lisa

    Daniel said:
    Ok, try this one:

    replace

    $content = $topfive->post_content;

    with:

    $mypost = get_post( $topfive->ID );
    $content = $mypost->post_excerpt;

    I’ll have to rewrite big portions of the theme’s code, because it’s a mess. This is one of the reasons an update has been delayed but expect one soon.

    #2085
    alloin
    Participant

    functions.php

    line 244;

    [code]$content = $topfive->post_content;
    $content = strip_tags($content);[/code]

    add below

    [code]$content = preg_replace(“/[caption.*[/caption]/”, ”, $content);[/code]

    cheers

    #2086
    ChattahoocheeNow
    Participant

    Hi Alloin, – THIS HAS CRASHED MY SITE

    I just tried it, got
    Parse error: syntax error, unexpected T_STRING in /home8/chattah2/public_html/wp-content/themes/cover-wp/functions.php on line 33

    And worse – when I tried to put back in the original code, got the SAME error and MY SITE IS DOWN

    #2087
    ChattahoocheeNow
    Participant

    bluehost.com tech support fixed it

Viewing 15 posts - 1 through 15 (of 19 total)

You must be logged in to reply to this topic.