• Resolved nate51

    (@nate51)


    I am working on a site that has a box that normally would have a feed brining in the most recent WordPress blog post. For some reason the posts have stopped updating and the one being displayed on the page is dated back from November 30th 2010. The HTML code being used on the site to import the posts is below

    <?php
    	query_posts(array(
    		'posts_per_page'=>1,
    		'category__in'=>array(4),
    		'category__not_in'=>array(22)
    	)
    	);
    	if(have_posts()){?>
    	<?php the_post();?>
    	<?php
    		$_tmp=get_the_excerpt('');
    		$_tmp=(strlen($_tmp)<250?$_tmp:substr($_tmp,0,250-3)."...");
    		echo "<p>".nl2br($_tmp); ?>
    	<p><a href="<?php the_permalink() ?>">More...</a></p>
    <?php
    	}else{?>
    	<p>No news at this Time, in the meantime <a href="blog">check out our blog</a></p>
    <?php
    	}?>

    I am not sure why the feed isnt updating as new posts are made. Does anyone know what might be going on here or can recommend a better system?

Viewing 1 replies (of 1 total)
  • Thread Starter nate51

    (@nate51)

    Solved half my own problem, hopefully this will help anyone with the same issue. I found another code to use and mixed and matched with the old code I had so that I could bring in the newest feed from the database but use the styling options from the previous box.

    <?php
    $args = array( 'numberposts' => 1 );
    $lastposts = get_posts( $args );
    foreach($lastposts as $post) : setup_postdata($post); ?>
        <?php
    		$_tmp=get_the_excerpt('');
    		$_tmp=(strlen($_tmp)<250?$_tmp:substr($_tmp,0,250-3)."...");
    		echo "<p>".nl2br($_tmp); ?>
        <p><a href="<?php the_permalink() ?>">More...</a></p>
    <?php endforeach; ?>

    Hope this helps anyone with a similar issue.

Viewing 1 replies (of 1 total)
  • The topic ‘Feed to another page’ is closed to new replies.