WordPress.org

Ready to get started?Download WordPress

Forums

PHP in Categories (2 posts)

  1. daenterpri
    Member
    Posted 5 years ago #

    Does anyone know of a good way that I can do a php include in each of my category description boxes?

    If not, can someone give me the php code to put in the archive.php file that basically says, "IF category ID equals 1, include this file. IF category ID equals 2, include this file, etc..."?

    Thanks!

  2. naholyr
    Member
    Posted 5 years ago #

    You could try this :

    include '/path/to/category-' . $wp_query->get('cat') . '.php';

    It will include "/path/to/category-1.php" for category ID 1, "/path/to/category-2.php" for category ID 2, etc...

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.