Community Forums › Forums › Archived Forums › Design Tips and Tricks › HELP
- This topic has 4 replies, 2 voices, and was last updated 9 years, 1 month ago by simon.glencross.
-
AuthorPosts
-
March 5, 2015 at 2:30 pm #143372simon.glencrossMember
I have been trying to implement the following for the past two days and I have little hair left!
I really could do with some help...
Here is what I am trying to implement..
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!? I have gone over the instructions a few times now and I'm at a loss
Thank you in advance for any assistance.
http://www.studiopress.community/topic/altitude-pro-home-page-styling-on-other-pages/March 6, 2015 at 6:35 pm #143538Victor FontModeratorThere is no function called "is_new_page" in WordPress unless you write one yourself. You should use is_page_template( 'newpage.php' )
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?March 6, 2015 at 6:52 pm #143541simon.glencrossMemberVictor thank you for your assistance, I know very little re coding. I have made the amendment to the output.php file but I am now getting the following error
Parse error: syntax error, unexpected end of file in /homepages/46/d87837406/htdocs/NXT/wp-content/themes/altitude-pro/lib/output.php on line 85
this is the content of my output.pho file
<?php
/*
* Adds the required CSS to the front end.
*/add_action( 'wp_enqueue_scripts', 'altitude_css' );
/**
* Checks the settings for the images and background colors for each image
* If any of these value are set the appropriate CSS is output
*
* @since 1.0
*/
function altitude_css() {$handle = defined( 'CHILD_THEME_NAME' ) && CHILD_THEME_NAME ? sanitize_title_with_dashes( CHILD_THEME_NAME ) : 'child-theme';
$color = get_theme_mod( 'altitude_accent_color', altitude_customizer_get_default_accent_color() );
$opts = apply_filters( 'altitude_images', array( '1', '3', '5', '7' ) );
$settings = array();
foreach( $opts as $opt ){
$settings[$opt]['image'] = preg_replace( '/^https?:/', '', get_option( $opt .'-altitude-image', sprintf( '%s/images/bg-%s.jpg', get_stylesheet_directory_uri(), $opt ) ) );
}$css = '';
foreach ( $settings as $section => $value ) {
$background = $value['image'] ? sprintf( 'background-image: url(%s);', $value['image'] ) : '';
if( is_front_page() ) {
$css .= ( ! empty( $section ) && ! empty( $background ) ) ? sprintf( '.front-page-%s { %s }', $section, $background ) : '';
}$css = '';
foreach ( $settings as $section => $value ) {
$background = $value['image'] ? sprintf( 'background-image: url(%s);', $value['image'] ) : '';
if( is_page_template( 'new-page.php' ) ) {
$css .= ( ! empty( $section ) && ! empty( $background ) ) ? sprintf( '.new-page-%s { %s }', $section, $background ) : '';
}}
$css .= ( altitude_customizer_get_default_accent_color() !== $color ) ? sprintf( '
a,
.entry-title a:hover,
.image-section a:hover,
.image-section .featured-content .entry-title a:hover,
.site-footer a:hover {
color: %1$s;
}button,
input[type="button"],
input[type="reset"],
input[type="submit"],
.archive-pagination li a:hover,
.archive-pagination .active a,
.button,
.footer-widgets,
.widget .button {
background-color: %1$s;
}button,
input[type="button"],
input[type="reset"],
input[type="submit"],
.button,
.front-page input:focus,
.front-page textarea:focus,
.widget .button {
border-color: %1$s;
}
', $color ) : '';if( $css ){
wp_add_inline_style( $handle, $css );
}March 6, 2015 at 8:18 pm #143545Victor FontModeratorThere's something wrong with your quotes. In the output.php I have on my development machine, several lines include 2 single quotes like this: '' . In what you posted above, the double single quotes are not single double quotes. Start with a new copy of output.php. Make sure you use straight quotes and not typographer's quotes.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?March 8, 2015 at 3:32 pm #143702simon.glencrossMemberVictor, I just wanted to say a big Thank You for your assistance it is very much appreciated. All is now working perfectly!
-
AuthorPosts
- The topic ‘HELP’ is closed to new replies.