combining php tags, can it work?
-
Can an if is_page be combined with get_posts? This doesn’t work, but shows what I’m attempting
<?php if (is_page('my_page')) { <ul> <?php global $post; $myposts = get_posts('category=4'); foreach($myposts as $post) : ?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?php endforeach; ?> </ul> } ?>No, I don’t know php as you can see. Have played with options from the codex, forums and web, but nothing works yet.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘combining php tags, can it work?’ is closed to new replies.