Put php into a page (ie not a template) through wysiwyg
-
Hi all,
I’ve created a new page (not a template) and called it “home”, on this page I have a few floats and I need to put the following code into a specific float:
<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’m having is that the wysiwyg is breaking the code. How can I call this into the page without it breaking?
It’s really important that it’s on the page and not the template.
Cheers
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Put php into a page (ie not a template) through wysiwyg’ is closed to new replies.