Community Forums › Forums › Archived Forums › General Discussion › Agency Pro – background problem
- This topic has 18 replies, 3 voices, and was last updated 9 years, 11 months ago by kiralytool.
-
AuthorPosts
-
January 19, 2014 at 3:09 pm #85950garnettaMember
I created a custom background 100 px wide x 1500 px tall and want it to tile horizontally for my background in Agency Pro. It's not tiling properly. Instead it's stretching a small portion to fill the screen cutting off the top of the image. I've selected "tile horizontal" in the custom background settings page.
????????
January 19, 2014 at 3:16 pm #85953AnitaKeymasterAgency Pro uses Backstretch. If you want to use the image you have designed that instead, you will need to remove the backstretch code from the theme.
Love coffee, chocolate and my Bella!
January 19, 2014 at 3:24 pm #85958garnettaMemberWhere is the backstretch code?
January 19, 2014 at 3:25 pm #85960AnitaKeymasterIt's located in your Functions.php file.
Love coffee, chocolate and my Bella!
January 19, 2014 at 3:44 pm #85965garnettaMemberI removed the code and it no longer displays a custom background image. This is what I removed from the Functions.php:
//* Enqueue Backstretch script and prepare images for loading
add_action( 'wp_enqueue_scripts', 'agency_enqueue_backstretch_scripts' );
function agency_enqueue_backstretch_scripts() {//* Load scripts only if custom background is being used
if ( ! get_background_image() )
return;wp_enqueue_script( 'agency-pro-backstretch', get_bloginfo( 'stylesheet_directory' ) . '/js/backstretch.js', array( 'jquery' ), '1.0.0' );
wp_enqueue_script( 'agency-pro-backstretch-set', get_bloginfo( 'stylesheet_directory' ).'/js/backstretch-set.js' , array( 'jquery', 'agency-pro-backstretch' ), '1.0.0' );wp_localize_script( 'agency-pro-backstretch-set', 'BackStretchImg', array( 'src' => str_replace( 'http:', '', get_background_image() ) ) );
}
January 19, 2014 at 3:46 pm #85966AnitaKeymasterOk, were you able to add your own image now?
Love coffee, chocolate and my Bella!
January 19, 2014 at 3:52 pm #85967garnettaMemberI can add the custom image and it shows it in the custom background settings page, but when I save it and view the page it's not there.
January 19, 2014 at 3:59 pm #85970AnitaKeymasterPlease share a link to the site so I can take a look.
Love coffee, chocolate and my Bella!
January 19, 2014 at 4:01 pm #85971garnettaMemberhttp://palspetcremationsedalia.com/pets
There's not much there because I just got started. 🙂
January 19, 2014 at 4:03 pm #85973AnitaKeymasterCan you give me a screenshot of the Appearance > Background page in your dashboard?
Love coffee, chocolate and my Bella!
January 19, 2014 at 4:10 pm #85974garnettaMemberYou can see the screenshot here: http://palspetcremationsedalia.com/example.jpg
January 19, 2014 at 4:12 pm #85976AnitaKeymasterDid you have that there before you removed the code or did you add it after you removed it?
Love coffee, chocolate and my Bella!
January 19, 2014 at 4:14 pm #85977garnettaMemberI re-added it after I removed the code.
January 19, 2014 at 4:15 pm #85978AnitaKeymasterLook in your Functions file and see if you have code related to this. If you do, copy and paste it over here.
add theme support for custom background
Love coffee, chocolate and my Bella!
January 19, 2014 at 4:18 pm #85979garnettaMemberThis code is still in my Functions file:
//* Add support for custom background
add_theme_support( 'custom-background', array( 'wp-head-callback' => 'agency_background_callback' ) );//* Add custom background callback for background color
function agency_background_callback() {if ( ! get_background_color() )
return;printf( '<style>body { background-color: #%s; }</style>' . "\n", get_background_color() );
}
January 19, 2014 at 4:19 pm #85980AnitaKeymasterReplace all of that with this -
`/** Add support for custom background */
add_theme_support( 'custom-background' );
Love coffee, chocolate and my Bella!
January 19, 2014 at 4:23 pm #85982garnettaMemberThat fixed it! Thank you so much!!
January 19, 2014 at 4:24 pm #85983AnitaKeymasterYou're welcome!
Love coffee, chocolate and my Bella!
April 8, 2014 at 1:14 pm #99104kiralytoolMemberThis solution led me to this error:
Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in /home/content/p3nexnas03/96/2062196/html/wp-content/themes/agency-pro/functions.php on line 83
Currently the site is not live and I was building it under GoDaddy...hopefully their support team can fix this issue for me without losing all my work.
Here's what I removed:
//* Enqueue Backstretch script and prepare images for loading
add_action( 'wp_enqueue_scripts', 'agency_enqueue_backstretch_scripts' );
function agency_enqueue_backstretch_scripts() {//* Load scripts only if custom background is being used
if ( ! get_background_image() )
return;wp_enqueue_script( 'agency-pro-backstretch', get_bloginfo( 'stylesheet_directory' ) . '/js/backstretch.js', array( 'jquery' ), '1.0.0' );
wp_enqueue_script( 'agency-pro-backstretch-set', get_bloginfo( 'stylesheet_directory' ).'/js/backstretch-set.js' , array( 'jquery', 'agency-pro-backstretch' ), '1.0.0' );wp_localize_script( 'agency-pro-backstretch-set', 'BackStretchImg', array( 'src' => str_replace( 'http:', '', get_background_image() ) ) );
}
----
//* Add support for custom background
add_theme_support( 'custom-background', array( 'wp-head-callback' => 'agency_background_callback' ) );//* Add custom background callback for background color
function agency_background_callback() {if ( ! get_background_color() )
return;printf( '<style>body { background-color: #%s !important; }</style>' . "\n", get_background_color() );
}
And here's what I replaced it with (per the previous posts):
`/** Add support for custom background */
add_theme_support( ‘custom-background’ );I received the error and have been locked out since hitting update.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.