Community Forums › Forums › Archived Forums › General Discussion › Altitude Pro home page styling on other pages
Tagged: altitude, Altitude Pro, create new, front page, homepage
- This topic has 5 replies, 5 voices, and was last updated 9 years, 11 months ago by
simon.glencross.
-
AuthorPosts
-
February 6, 2015 at 4:21 am #139929
ToniLaird
MemberI really like your latest Altitude Pro and would like to ask if it's possible to style other pages/posts as your home page demo?
February 19, 2015 at 8:40 am #141300tamjl
MemberI am interested in this as well. One of the sites built with Altitude Pro and featured in the theme showcase seems to do this, but I'm not clear if it's as easy as a setting change or a deeper dive into .php files.
February 21, 2015 at 10:11 am #141644tsmcauley
MemberI want every blog post to be like the home page!
February 22, 2015 at 12:46 pm #141770Titan
MemberI was curious about how to recreate the homepage (front-page) for other pages as well. I am new to Genesis and php but was able to figure it out fairly easily. Fortunately, Altitude is a very lightweight and compact theme so there was not a lot of code to replicate. If anyone else is interested in recreating the homepage of Altitude, here are the steps that I took.
1) Create a new .php file for the page you want to create. I called mine new-page.php for this example.
2) Open the front-page.php file in the altitude-pro directory of your child theme. Copy the contents of the front-page.php and paste them into the new-page.php file.
3) Add the following line to the top of the new-page.php/* Template Name: New Page */
Add it right below this section:
/** * This file adds the New Page template to the Altitude Pro Theme. * * @author StudioPress * @package Altitude * @subpackage Customizations */
4) Next I went through the new-page.php file and changed every instance of "front-page" to "new-page". If you are using Notedpad++ there is a Search function to make finding each instance easier and ensure you do not miss one.
5) Now it is time to register to register the new widget locations for new-page.php. Open the functions.php file and copy and paste the following code at the bottom of the page:
//* Register new-page widget areas genesis_register_sidebar( array( 'id' => 'new-page-1', 'name' => __( 'New Page 1', 'altitude' ), 'description' => __( 'This is the new page 1 section.', 'altitude' ), ) ); genesis_register_sidebar( array( 'id' => 'new-page-2', 'name' => __( 'New Page 2', 'altitude' ), 'description' => __( 'This is the new page 2 section.', 'altitude' ), ) ); genesis_register_sidebar( array( 'id' => 'new-page-3', 'name' => __( 'New Page 3', 'altitude' ), 'description' => __( 'This is the new page 3 section.', 'altitude' ), ) ); genesis_register_sidebar( array( 'id' => 'new-page-4', 'name' => __( 'New Page 4', 'altitude' ), 'description' => __( 'This is the new page 4 section.', 'altitude' ), ) ); genesis_register_sidebar( array( 'id' => 'new-page-5', 'name' => __( 'New Page 5', 'altitude' ), 'description' => __( 'This is the new page 5 section.', 'altitude' ), ) ); genesis_register_sidebar( array( 'id' => 'new-page-6', 'name' => __( 'New Page 6', 'altitude' ), 'description' => __( 'This is the new page 6 section.', 'altitude' ), ) ); genesis_register_sidebar( array( 'id' => 'new-page-7', 'name' => __( 'New Page 7', 'altitude' ), 'description' => __( 'This is the new page 7 section.', 'altitude' ), ) );
6) Next I went into the lib folder and opened output.php. Here there is a section starting with "foreach". I copied the "if" statement and then pasted this below it:
if( is_new_page() ) { $css .= ( ! empty( $section ) && ! empty( $background ) ) ? sprintf( '.new-page-%s { %s }', $section, $background ) : ''; }
7) Finally came the CSS. I opened the style.css and again using the Search function in Notepad++ copied and pasted each instance of ".front-page" and replaced it with ".new-page".
I am not sure if all of these steps were necessary. It seems I should have been able to use the existing front-page css stylings for the new-page css. However, I figured if I wanted to isolate changes later on it was best to go ahead and have its own css entries.
To be able to use your newly created page you will need to go to Pages > Add New and create a new page and select the template name that you created back in step 3. Save the new page and then be sure to add it to your menu structure.
To edit the new page, go to Appearance > Customize and then use the menu navigation to navigate to New Page and from there you should able to start editing the widgets just like on your homepage.
Hope this helps someone to be able to customize this theme. It is a pretty nice and simple to work with. I am actually wanting to create a new Page Template for this theme. This was a way of drilling into the php and seeing how everything fits together. If anyone has any advice for creating Page Templates in general I would appreciate any feedback or suggestions.
February 23, 2015 at 6:30 pm #141946Titan
MemberWell..good effort on my part. Appears I still need to add some settings to the customize.php in order to get the image selector to show up in the Customize area on the backend.
So this is part of the equation.
March 4, 2015 at 4:29 am #143152simon.glencross
MemberI have tried to implement the above and I am almost there! BUT when I try and add the end to to the output.php file I am getting the following error
Fatal error: Call to undefined function is_new_page() in /homepages/46/d87837406/htdocs/NXT/wp-content/themes/altitude-pro/lib/output.php on line 33
I have the following in the output.php file
$css = '';
foreach ( $settings as $section => $value ) {
$background = $value['image'] ? sprintf( 'background-image: url(%s);', $value['image'] ) : '';
if( is_new_page() ) {
$css .= ( ! empty( $section ) && ! empty( $background ) ) ? sprintf( '.new-page-%s { %s }', $section, $background ) : '';
}if( is_front_page() ) {
$css .= ( ! empty( $section ) && ! empty( $background ) ) ? sprintf( '.front-page-%s { %s }', $section, $background ) : '';
}What am I missing!?
Thank you in advance for any assistance.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.