Forum Replies Created
-
AuthorPosts
-
thisisarp
MemberHere's some oddness - I deleted all the footer widgets (instead of just making them inactive), added the core Meta widget and ... footer widgets exist on the site now.
thisisarp
MemberThanks - I do know that the footer does not appear on the home page. And I have a staging copy of the site (not available to the public) with cache/autoptimize disabled and the footer widgets are still missing.
I'm going to try the theme on another site and see if the footer widgets are still missing - and try downloading the theme again.
November 28, 2016 at 9:28 am in reply to: Copied front page template for another page, background images missing… #196724thisisarp
MemberThis one, trying to output based on the page template (which would be ideal) didn't break the site but didn't work either (my new template's filename is sales-page.php and is located in the root theme folder):
I gave it a shot but no dice.
November 27, 2016 at 10:58 am in reply to: Copied front page template for another page, background images missing… #196696thisisarp
MemberAll I'm trying to do is output the css for the bg images that appears on the home page. I found the relevant code in output.php:
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 ) : ''; } }
I tried a couple of variants on it, taking out what seemed to be irrelevant. This one, to get it to output based on page ID, broke the site:
function infinity_css_sales() { $handle = defined( 'CHILD_THEME_NAME' ) && CHILD_THEME_NAME ? sanitize_title_with_dashes( CHILD_THEME_NAME ) : 'child-theme'; $opts = apply_filters( 'infinity_images', array( '1', '3', '5', '7' ) ); $settings = array(); foreach( $opts as $opt ) { $settings[$opt]['image'] = preg_replace( '/^https?:/', '', get_option( $opt .'-infinity-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_single( '632' ) ) ) { $css .= ( ! empty( $section ) && ! empty( $background ) ) ? sprintf( '.front-page-%s { %s }', $section, $background ) : ''; } } if ( $css ) { wp_add_inline_style( $handle, $css ); } }
This one, trying to output based on the page template (which would be ideal) didn't break the site but didn't work either (my new template's filename is sales-page.php and is located in the root theme folder):
function infinity_css_sales() { $handle = defined( 'CHILD_THEME_NAME' ) && CHILD_THEME_NAME ? sanitize_title_with_dashes( CHILD_THEME_NAME ) : 'child-theme'; $opts = apply_filters( 'infinity_images', array( '1', '3', '5', '7' ) ); $settings = array(); foreach( $opts as $opt ) { $settings[$opt]['image'] = preg_replace( '/^https?:/', '', get_option( $opt .'-infinity-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_page_template( 'sales-page.php' ) ) { $css .= ( ! empty( $section ) && ! empty( $background ) ) ? sprintf( '.front-page-%s { %s }', $section, $background ) : ''; } } if ( $css ) { wp_add_inline_style( $handle, $css ); } }
I know I'm close but am clearly missing something. I know enough php to get in trouble 😉
November 26, 2016 at 10:05 am in reply to: Copied front page template for another page, background images missing… #196660thisisarp
MemberThanks - I know those are my options. I haven't found the current php code yet - that's more the assistance I'm looking for.
November 25, 2016 at 9:48 am in reply to: Copied front page template for another page, background images missing… #196622thisisarp
MemberThat's correct. But the CSS for the background images is outputted in the source code of the home page only.
<style id='infinity-pro-inline-css' type='text/css'> .front-page-1 { background-image: url(//blah/pic.jpg); }.front-page-3 { background-image: url(//blah/pic.jpg); }.front-page-5 { background-image: url(//blah/pic.jpg); }.front-page-7 { background-image: url(//blah/pic.jpg); }
The inline-css is output on all pages but the portion with the background images is *only* on the front page.
I'm sure there's a function where I could copy that & also output it to pages that uses the Sales template (ie a copy of the Homepage template) but I haven't found it yet. Or at least do so based on the page ID involved.
September 30, 2016 at 1:34 pm in reply to: Altitude Pro: replicate home page as an interior page, replace hero with slider? #194019thisisarp
MemberThanks!
-
AuthorPosts