WordPress.org

Ready to get started?Download WordPress

Forums

Optional <index.php> override in categories (4 posts)

  1. Anonymous
    Unregistered
    Posted 10 years ago #

    Is it possible do add an extra field in the categories (admin) section to override the default page (index.php) so that when choosing that category the specified .php file is loaded instead of the default?
    Thanks
    icxn

  2. lane
    Member
    Posted 10 years ago #

    I don't think so, but you could manually enter the catagories in the menu section rather than dynamaciallly generating them through WP. That way, you can have the link go to any .php file you want.
    HTH

  3. Beel
    Member
    Posted 10 years ago #

    Not sure if something like this would help, but say you wanted to redirect category 3, you could try this in your index file:
    <?php
    if ($_GET['cat'] == 3) {
    $redirect_to = get_settings('siteurl') . '/whatever.php';
    header ("Location: $redirect_to");
    } ?>

  4. Anonymous
    Unregistered
    Posted 10 years ago #

    Thanks Beel!
    Now how would you modify that to redirect to the right .php file when requesting a single article. We need to extract the category to which the article belongs first, right (and how)?
    icxn

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.