I added an rss feed of guest blog posts from another site in my sidebar. However, it did not match the styles of the site, so I was trying to edit the code so that it would use the same style as the regular blog post feed, which is just above the guest blog posts. In doing so, I copied the original code and saved it into a txt file, in case of problems, so I could easily just copy and paste it back into the site, which is a wordpress based site.
Well, when I made the changes, it did not work. The page loads with only the header and background, but the section where the content is supposed to be is a blank white space. So, I grabbed the original code and pasted it back into the page, but for some reason it is still showing nothing but the header and background with a white space where the content should be. I’m at a loss of what to do . I thought I had myself covered, since I created a copy of the code that was working. I’ve been staring at this code for hours trying to find what is wrong, to no avail. I’m probably staring right at it, but because I’ve been looking at it so long it’s become a blindspot. IDK
I tried getting the error to display by pasting this code into the top of the file:
<?php ini_set('display_errors',1); error_reporting(E_ALL); ?>It doesn’t show me anything. Is there anyone who could help me fix this issue? I just dont’ understand why the original code is not working, when it was working fine before. All I did was copy and paste it from a txt file.
Any help I can get will be greatly appreciated! Let me know what I need to do, if you would like me to copy and paste the code here or what.
The code is as follows:
<div class="blog_top_cor"><img src="<?php bloginfo('template_url'); ?>/images/left-column_top.png" alt="" /></div>
<div class="blog_center_main_con">
<div class="blog_heading_con"><img src="<?php bloginfo('template_url'); ?>/images/blog_header.png" alt="" /></div>
<?php query_posts('posts_per_page=4'); ?>
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<div class="blog_video_main_con">
<div id="post-<?php the_ID(); ?>" class="blog_video_con video_font">
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?
php the_title(); ?>
</div><!-- #post-## -->
<div class="blog_posted_con posted_font">
Posted <?php the_time('F jS, Y') ?>
</div>
<div class="blog_line_con"></div>
</div>
<?php endwhile; ?>
<?php
$rss = new DOMDocument();
$rss->load('http://www.theterrilevineshow.com/category/guests/feed');
$feed = array();
foreach ($rss->getElementsByTagName('item') as $node) {
$item = array (
'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,
'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,
'date' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue,
);
array_push($feed, $item);
}
$limit = 5;
for($x=0;$x<$limit;$x++) {
$title = str_replace(' & ', ' & ', $feed[$x]['title']);
$link = $feed[$x]['link'];
$date = date('l F d, Y', strtotime($feed[$x]['date']));
echo '<p><strong><a href="'.$link.'" title="'.$title.'">'.$title.'</a></strong><br />';
echo '<p><small><em>Posted on '.$date.'</em></small></p>';
echo '<p>'.$description.'</p>';
}
?>
<div class="coaching_training_pic"><a href="http://www.terrilevine.com/could-you-do"><img src="<?php bloginfo
(‘template_url’); ?>/images/coach-training_button.png" alt="" border=“0” />
<div class="icons_main_con">
</div>
<div class="blog_top_cor"><img src="<?php bloginfo('template_url'); ?>/images/left_bottom.png" alt="" style="position: absolute;" /></div>
</div>
<?php wp_reset_query(); ?>
Got my fingers crossed that someone can help me! I have to get this site back to normal. egads the challenges of being a noob
Thanks!