Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

i'm a wp newbie working with an existing site. i've been asked to add a unique page to the site and am having trouble finding out if this is possible. the current site would not change, but there would be a unique page sharing only the navigation menu of the site. not sure what to call it to research how to's

any help appreciated. thank you

share|improve this question
2  
I know you are new here... in order to get a good answer, you need to ask a good question. Without providing any code, is hard to help you. Having said that... you should look into your header.php file. You could add an if statement at the very top after the navigation checking to see in which page you're in. Then you can add a different template to that specific page. Do some research, read the codex -> codex.wordpress.org/Conditional_Tags - see what you can come up with. Most people here are willing to help, if you're willing to show some effort. –  gdaniel Feb 28 at 21:47

2 Answers 2

There are several ways to do that depending on the type of the content which will be in the page, but the most straight forward is to creat a new page template that will generate the content/visual in the required way, then create a page and assign the template to it. The page then will be your required "Unique" page.

share|improve this answer

Create a new page template and add a unique body class so you can style it differently if needed.

//* Add landing body class to the head
add_filter( 'body_class', 'wpsites_landing_page_body_class' );
function wpsites_landing_page_body_class( $classes ) {
if(is_page_template('/page-landing.php')){

$classes[] = 'template-landing-page';
return $classes;

}}

Or you could add the custom body class directly to your landing page template file.

Name it something like page_landing.php and add it to the root directory of your child theme.

You could copy over an existing page template from your parent theme and remove most of the code so only the navigation menu displays like a landing page.

Here's all the sample code you can add to a new file.

<?php
/**
 * This file adds the Landing Page Template to the Twenty Twelve theme.
 *
 * @author Brad Dalton
 * @package Twenty Twelve
 * @subpackage Customizations
 */

/*
Template Name: Landing Page
*/
get_header(); ?>

<div id="primary" class="site-content">
    <div id="content" role="main">

        <?php while ( have_posts() ) : the_post(); ?>
            <?php get_template_part( 'content', 'page' ); ?>
        <?php endwhile; // end of the loop. ?>

    </div><!-- #content -->
</div><!-- #primary -->

The nav menu classes will need to match your themes. These are taken from the Twenty Twelve default theme.

Sample CSS for your child themes style.css file.

/* Landing Page Styles
--------------------------------------------- */

body.template-landing-page {
background-color: #222;
}

.template-landing-page .site-inner,
.template-landing-page .wrap {
max-width: 800px;
}

.template-landing-page .site-inner {
padding-bottom: 40px;
padding-bottom: 4rem;
}

.template-landing-page .content {
background-color: #fff;
padding: 50px 60px 24px;
padding: 5rem 6rem 2.4rem;
}

You could also control the landing page width using PHP code in your child themes functions.php file

function wpsites_landing_page_content_width() {
if ( is_page_template( '/page-landing.php' ) ) {
    global $content_width;
    $content_width = 960;
    }
}
add_action( 'template_redirect', 'wpsites_landing_page_content_width' );
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.