after banging my head for 3 days now i decided to post here and ask for help.
Due to a couple of syndications (RSS Feeds) i need to format some of the syndicated posts with different css settings (e.g. images to float left, paragraphs to get smaller margins, etc.). To do this i add custom fields while i grap the rss feeds. This customfields than get applied to the post as css class. This all is working perfect but now i need the post id for my div container aswell. And that is where i strugle.
I use Atahualpa 3.4.5.1 and i tried the following code in "The Loop" from the "style and edit center column" section:
PHP Code:
<?php
/* get custom field myclass for this post */
$myclass = get_post_custom_values("myclass");
/* check wether myclass has any value */
if ($myclass == ''){
/* no value? use standard output */
bfa_post_bodycopy('<div class="post-bodycopy clearfix">','</div>');
} else {
/* we got value! now add an additional div container */
bfa_post_bodycopy('<div class="post-bodycopy clearfix"><div class ="'.$myclass[0].'" id="myid'.the_ID().'">','</div></div>');
}
?>
If tried <div class ="'.$myclass[0].'" id="myid'.$post->ID.'"> aswell. But that does not output the post_id.
I can wrap an additional div arround the bfa_post_bodycopy with the id in it:
PHP Code:
<?php
$myclass = get_post_custom_values("myclass");
if ($myclass == ''){
bfa_post_bodycopy('<div class="post-bodycopy clearfix">','</div>');
} else {
?><div id=pb"<?php the_ID(); ?>"><?php
bfa_post_bodycopy('<div class="post-bodycopy clearfix"><div class ="'.$myclass[0].'">','</div></div>');
?></div><?php
}
?>
Can anyone please push me into the right direction? What am i missing?
Regards
Michael