Forums

Putting A catagory on a page with an include? (4 posts)

  1. Cattrin
    Member
    Posted 6 years ago #

    Hello. I was wondering if I could put a certain catagory on a page, or list a catagory in the pages menu. I did a search, and the topic I found simply stated that Catagories and pages are seperate.

    So, I was curious to know if I could do something like an include. I've never made my own mod before... so I'm not looking to do that. I have a catagory for my photography. What I want to do is make a page, then 'include' the catagory file via php.

    Something similar is the contact form I have set up. There's a file on my webspace, In Touch. When making a page, i just put <!--intouch--> and it brings up that in touch form in the page itself. I want somethign like this, but I want to bring up the photography catagory. I don't even need the quick tag, I just need to call it once for one page.

    All help is apprecated, and thanks! ^.^

    ~Catt

  2. Joshua Sigar
    Member
    Posted 6 years ago #

    Download the following plugin, which will allow you to insert php code in a post.
    http://priyadi.net/archives/2005/03/02/wordpress-php-exec-plugin/

    And then insert the following code to call all posts of category "photo"
    <phpcode>
    <ul>
    <?php $my_query = new WP_Query('category_name=photo'); ?>
    <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
    <li><a href="<?php the_permalink() ?>"><?php the_content(); ?></a></li>
    <?php endwhile; ?>
    </ul>
    </phpcode>

  3. Cattrin
    Member
    Posted 6 years ago #

    Wow! thanks so much! Works perfectly!

    Also, is there a way to include a comments link? I tried placing
    <?php comments_popup_link(__('Comments'), __('1 Comment'), __('% Comments')); ?>
    after the content piece, but no luck.

  4. jonimueller
    Member
    Posted 6 years ago #

    I was beaten to the punch, but I quite like David Chait's CG-QuickPHP plugin that lets you create any kind of php code on those WP Pages.

    You can try it out here:

    http://www.chait.net/download.php?filename=cg-quickphp-08.zip

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.