rob_the_villain
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Change theme infoNope that doesn’t work either.
Cheers
Forum: Themes and Templates
In reply to: Change theme infoThanks 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
Forum: Fixing WordPress
In reply to: Put php into a page (ie not a template) through wysiwygSolved 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.
Forum: Fixing WordPress
In reply to: Put php into a page (ie not a template) through wysiwygOh 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
Forum: Fixing WordPress
In reply to: Put php into a page (ie not a template) through wysiwygHaha, 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
Forum: Fixing WordPress
In reply to: Put php into a page (ie not a template) through wysiwygI’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?
Forum: Fixing WordPress
In reply to: Put php into a page (ie not a template) through wysiwygThanks for replying.
I’ve tried through the html editor and it still breaks it. Shall have a look for a plugin.
Thanks
Forum: Fixing WordPress
In reply to: Show date/time differently and show comments on postsSolved!
<?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; ?>