Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter rob_the_villain

    (@rob_the_villain)

    Nope that doesn’t work either.

    Cheers

    Thread Starter rob_the_villain

    (@rob_the_villain)

    Thanks for replying. I’ve tried keeping the structure the same but everytime I click save it reloads the page and says “the requested theme does not exist”.

    I tried changing the theme name to something else and that message comes up.

    Kinda frustrating as it’s all my design!

    Cheers

    Thread Starter rob_the_villain

    (@rob_the_villain)

    Solved with putting the following code directly into the wysiwyg using the php plugin:

    <?php
     global $post;
     $myposts = get_posts('numberposts=5');
     foreach($myposts as $post) :
       setup_postdata($post);
     ?>
     <h5><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5>
    <small><?php echo human_time_diff(get_the_time('U'), current_time('timestamp')) . ' ago'; ?> <span>?</span> <a href="<?php the_permalink(); ?>#comments" title="View comments about <?php the_title(); ?>"><?php comments_number('No Comments', '1 Comment', '% Comments' );?></a></small>
    <br />
    <br />
     <?php endforeach; ?>

    Cheers for the help Rev.

    Thread Starter rob_the_villain

    (@rob_the_villain)

    Oh dear, that didn’t go well!

    I just put into the page to get another template (thanks to the php plugin), I then put this code into the new template:

    <?php
    /**
     * @package WordPress
     * @subpackage Default_Theme
     */
    ?>
    
    <h4>Latest Blog Posts</h4>
    <?php $postslist = get_posts('numberposts=5&order=DSC&orderby=date'); foreach ($postslist as $post) : setup_postdata($post);?>
    <h5><a href="<?php the_permalink(); ?>">
      <?php the_title(); ?>
      </a></h5>
    <small> <?php echo human_time_diff(get_the_time('U'), current_time('timestamp')) . ' ago'; ?> <span>?</span> <a href="<?php the_permalink() ?>#comments" title="View comments about <?php the_title(); ?>">
    <?php comments_number('No Comments', '1 Comment', '% Comments' );?>
    </a> </small> <br />
    <br />
    <?php endforeach; ?>

    I’m getting this error:

    Fatal error: Call to undefined function get_latestposts() in /home/metahousemedia/metahousemedia.com/wp-content/plugins/php-execution-plugin/includes/class.php_execution.php(273) : eval()'d code on line 8

    Thread Starter rob_the_villain

    (@rob_the_villain)

    Haha, yep, not really thinking it through, I’ll just get it to grab a template and hopefully it’ll act as I want it. Thanks

    Thread Starter rob_the_villain

    (@rob_the_villain)

    I’ve got a plugin that executes the code, just need some adjustments to it.

    <h4>Latest Blog Posts</h4>
    		<?php $postslist = get_posts('numberposts=5&order=DSC&orderby=date'); foreach ($postslist as $post) : setup_postdata($post);?>
    		<h5><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5>
     		<small>
    			<?php echo human_time_diff(get_the_time('U'), current_time('timestamp')) . ' ago'; ?>
    			<span>?</span>
    			<a href="<?php the_permalink() ?>#comments" title="View comments about <?php the_title(); ?>"><?php comments_number('No Comments', '1 Comment', '% Comments' );?></a>
    		</small>
    		<br />
    		<br />
     		<?php endforeach; ?>

    The problem I have is that instead of picking up the post titles, links to posts etc etc it’s just picking up the homepage info. So each title says “home” rather than the posts title and each one just reloads the home page. Can anyone help?

    Thread Starter rob_the_villain

    (@rob_the_villain)

    Thanks for replying.

    I’ve tried through the html editor and it still breaks it. Shall have a look for a plugin.

    Thanks

    Thread Starter rob_the_villain

    (@rob_the_villain)

    Solved!

    <?php $postslist = get_posts('numberposts=5&order=ASC&orderby=date'); foreach ($postslist as $post) : setup_postdata($post);?>
    		<h5><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5>
     		<?php echo human_time_diff(get_the_time('U'), current_time('timestamp')) . ' ago'; ?> <?php comments_number('No Comments', '1 Comment', '% Comments' );?>
     		<?php endforeach; ?>
Viewing 8 replies - 1 through 8 (of 8 total)