-
ChattahoocheeNowParticipant
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…
LisaDaniel TaraKeymasterThat 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.
ChattahoocheeNowParticipantThanks 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?
ChattahoocheeNowParticipantActually – just tried removing the featured photo (only the featured photo – left it within the post), but the caption code still displays.
ChattahoocheeNowParticipantCurious…. why does it happen on the “Popular” but not on the left-hand column, which I have modified to be a particular category?
Daniel TaraKeymasterIt 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.
ChattahoocheeNowParticipantSorry 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.pngThe Billboard story appeared in both columns, but only in the Popular column does the code show.
Daniel TaraKeymasterOK, 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;
ChattahoocheeNowParticipantThanks 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
Daniel TaraKeymasterOk, 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.
ChattahoocheeNowParticipantThank 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.
alloinParticipantfunctions.php
line 244;
[code]$content = $topfive->post_content;
$content = strip_tags($content);[/code]add below
[code]$content = preg_replace(“/[caption.*[/caption]/”, ”, $content);[/code]
cheers
ChattahoocheeNowParticipantHi 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 33And worse – when I tried to put back in the original code, got the SAME error and MY SITE IS DOWN
You must be logged in to reply to this topic.