• Hi every one..
    I am new to WP Theme Development i have a question that i want to add my custom php pages like (contact us,About us, etc) how can i redirect from index page of the theme to these pages???

    Thanks in Advance

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hmm… are your custom php pages custom templates for the normal wordpress pages, so that you want to use them instead of page.php ?
    If yes… you’ll just need to add the template name to your custom php template files… e.g.

    <?php
    /*
    Template Name: Custom-Template-About-Me
    */
    
    get_header();?>
    
    <?php if (have_posts()) { while (have_posts()) : the_post(); ?>
    ...
    ..
    .

    So you can chose this template for any page in your dashboard.

    or you can use in index.php:
    <?php if (is_page('slug_of_page')) require ('costum.php)';?>

    Thread Starter UsmanButt

    (@usmanbutt)

    egado Thank you sooooo much i got it working thanks alot

    Thread Starter UsmanButt

    (@usmanbutt)

    Hologen
    Thanks for the reply now it is working for me ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add php files in Theme’ is closed to new replies.