Thread Starter
vsp
(@vsp)
I hope my question is being understood. What I want to do is to create a page that’s not the front page that displays like a category archive, except of 3 differnt categories put together. I hope this helps.
Are you using a plugin that allows pages to execute php? If not, look in the codex for one.
Thread Starter
vsp
(@vsp)
that sounds like just the thing. i’m looking for it now, but if anyone knows a good plugin i would like a link.
Thread Starter
vsp
(@vsp)
I got the plugin RunPHP, but it doens’t seem to be working. does anyone have any suggestions?
PHP-Exec is another option
Thread Starter
vsp
(@vsp)
im using PHP-Exec, and it’s working, except a weird thing is happening. it is just supposed to display post titles, which it’s doing, but under all the titles it is displaying all the posts. take a look: http://70.103.140.131/~cohaorg/?page_id=160
here’s my code if anyone would be kind enough to take a look:
<phpcode>
<?php query_posts('cat=2,18,15'); ?>
<?php if (have_posts()) : ?>
<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post">
<h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h3>
<h5>By <?php
$custom = get_post_custom_values('Author');
if (count($custom) != 0)
{
// do your thing
echo $custom[0];
// maybe do more things
} ?>
</h5>
<small><?php the_time('l, F jS, Y') ?></small>
</div>
<?php endwhile; ?>
<?php else : ?>
<h2 class="center">Not Found</h2>
<?php include (TEMPLATEPATH . '/searchform.php'); ?>
<?php endif; ?>
</phpcode>
Thread Starter
vsp
(@vsp)
bump
[Do not bump after 45 minutes – or you’ll get banned/suspended! (mod)]
Looks like the loop is still pulling the posts after your PHP code…
Thread Starter
vsp
(@vsp)
why would it be doing that when i didnt call in the loop?
What happens when you remove the if/else statement?
<phpcode>
<?php query_posts('cat=2,18,15'); ?>
<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post">
<h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h3>
<h5>By <?php
$custom = get_post_custom_values('Author');
if (count($custom) != 0)
{
// do your thing
echo $custom[0];
// maybe do more things
} ?>
</h5>
<small><?php the_time('l, F jS, Y') ?></small>
</div>
<?php endwhile; ?>
</phpcode>
Thread Starter
vsp
(@vsp)
it’s still doing the same thing. i know the code should work , because it’s the same code im using on my front page
Is that all that’s on the page? Just that PHP?
possibly its an issue with your page.php template?
Thread Starter
vsp
(@vsp)
i dont think it’s an issue with page.php because none of the other pages have this problem. does anyone have an idea?