Home>Support>Updated Theme – Everything is gone :o

Updated Theme – Everything is gone :o

Hello Site Origin Theme,

We can’t get tired of using Vantage Pro, great theme and the best support ever. We have this new issue:

We developed a site for a cliente, made a child theme and added some custom mods ( https://siteorigin.com/thread/add-jquery-moving-background/ ). We finished changed it to his server and when he updated the theme, everything went wrong and some styles and the JS disappeared.

How it looks before the update: http://sp.servicioswebmex.com/
How it looks now (after the update): http://spacefood.com.mx/

We checked both sites (since we have the installation before the update and after), our customizer settings where reseted but that is an easy fix.

The hard part is this:

To have the moving clouds in the background we added the following files to the folder:
public_html/sp/wp-content/themes/vantage/js

clouds.js > https://www.dropbox.com/s/ob4pua797j7t3wa/clouds.js?dl=0
xfunctions.js > https://www.dropbox.com/s/a5vmaoj1c0b93gs/xfunctions.js?dl=0

and public_html/sp/wp-content/themes/vantage/js/items
> https://www.dropbox.com/s/tls6o5wookmd859/Captura%20de%20pantalla%202015-08-21%20a%20las%2018.23.22.png?dl=0

To get it working on the installation previous to the update we added the following functions to the file public_html/sp/wp-content/themes/vantage

in header.php we added:

URL: http://spacefood.com.mx/

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 8 years, 11 months ago Jose AMezcua
    <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/xfunciones.js"></script>
    

    in functions.php we added:

    function mi_inicio() {
    	if (!is_admin()) {
    		wp_enqueue_script('jquery');
    	}
    }
    add_action('init', 'mi_inicio');
    
    
    function register_head_scripts() {
    $url = 'http://sp.servicioswebmex.com/wp-includes/css/clouds.js';  // Add the path to your .js file
    
    }
    add_action('wp_head', 'register_head_scripts');
    
    
    if( !is_admin()){
       wp_deregister_script('jquery');
       wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"), false, '');
       wp_enqueue_script('jquery');
       }
    

    And it worked perfectly, so basically we need help with this:
    The footer got really messed up. (we configured it using CSS)
    And the moving background is not working. (we already did exactly the same things we did to the site before the update: uploading the 2 js files, the clouds image and added the code to the header.php and functions.php on the vantage theme, but it is not working)

    We we did not confuse you, english is not our first language.
    Please help us we already delivered the website and ran out of resources and ideas :/

    Thanks again for everything and we hope to hear from you guys soon!
    Cheers from Mexico,
    J.

  2. 8 years, 11 months ago Andrew Misplon
    Hi, I Work Here

    Hi Jose :)

    Let’s start with the child theme. I just glanced at the sources in my developer tool and it looks a little wild and crazy in there. I can see two stylesheets loading in the child theme, both have the full parent style.css contents in them. This alone can cause challenges. Please, ZIP the child theme, upload to any public source, use Private Reply below and send me the link. I’ll take a look and try advise from there. Thanks!

  3. 8 years, 11 months ago Private Message - Jose AMezcua

    This is a private message.

  4. 8 years, 11 months ago Andrew Misplon
    Hi, I Work Here

    Thanks for the feedback. How to troubleshoot? Many ways, one way as I’m doing now is to take the page source from the working home page and save it and then take the page source from the broken home page and save it and then run a diff using your preferred app. For example: https://sourcegear.com/diffmerge/. This allows you to start digging.

    Here is how your broken home page is loading CSS:

    <link rel='stylesheet' id='parent-style-css'  href='http://spacefood.com.mx/wp-content/themes/vantage/style.css?ver=4.3.1' type='text/css' media='all' />
    <link rel='stylesheet' id='child-style-css'  href='http://spacefood.com.mx/wp-content/themes/child-vantage/style.css?ver=4.3.1' type='text/css' media='all' />
    <link rel='stylesheet' id='vantage-style-css'  href='http://spacefood.com.mx/wp-content/themes/child-vantage/style.css?ver=2.4.4' type='text/css' media='all' />
    

    Try changing lines 1-6 in your child theme to the following:

    <?php
    
    /**
     * Enqueue the parent theme stylesheet.
     */
    function vantage_child_enqueue_parent_style() {
        wp_enqueue_style( 'vantage-parent-style', get_template_directory_uri() . '/style.css' );
    }
    add_action( 'wp_enqueue_scripts', 'vantage_child_enqueue_parent_style', 8 );
    

    That’s all you need for that part.

    As we chatted about before, you’ll need to have a look at style.css in the child theme. When you’re finished it must only have the edited rules in it.

    Finally, this might be the problem. The Customizer settings aren’t the same between these two sites. That might be part of the issue. Check the two Customizer > Theme Design sections and compare against each other.

    Also in this site: Private Snippet there is a moving background image. On this site I’m not sure it’s there: Private Snippet. Have you checked that the same plugin is working on both sites?

  5. 8 years, 11 months ago Jose AMezcua

    Hey Andrew,

    we solved the moving background issue. We did not use a plugin to add it we actually used some custom php and added some code to the header.php and the functions.php The problem was we added it to the parent theme and when we did the update it was all gone, so how can we add it to the child them so it will stay the same after the updates:

    This is what we added to the header.php

    <body <?php body_class('divNubes'); ?>> 
    

    This is what we added to the functions.php

    if( !is_admin())
    {
      wp_deregister_script('jquery');
      wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"), false, '');
      wp_enqueue_script('jquery');
    }
    

    And this is what we added to the functions.php inside wp_head()

    function wp_head()
    {
    <link rel="stylesheet" href="http://sp.servicioswebmex.com/wp-includes/css/style.css"/>
    	<script type="text/javascript" src="http://sp.servicioswebmex.com/wp-includes/js/jquery/jquery.js"></script>
    	<script type="text/javascript" src="http://sp.servicioswebmex.com/wp-includes/css/clouds.js"></script>
    	<script type="text/javascript" src="http://sp.servicioswebmex.com/wp-includes/css/jquery-1.11.3.min.js"></script>
    } 
    

    Hope you can help!
    Thanks,
    J

  6. 8 years, 11 months ago Andrew Misplon
    Hi, I Work Here

    For the body class, please, see:

    https://codex.wordpress.org/Function_Reference/body_class#Add_Classes_By_Filters

    That can be done from within your child theme.

    As far as going further. We don’t, officially, offer any customisation support on this level. I’ve already spent some time checking everything out. Ideally I need your team to continue the hunt for the problem. This isn’t really a matter of asking me a question, I’d have to keep combing the two sites to figure out where the problems are. It’s basically a custom development task :) I hope you understand the challenge of our support policy vs what you’re asking. I’ve already gone over what I’m ideally meant to be working on here on the forums.

    So my advice now:

    1. Download DiffMerge.
    2. Compare the outputs of each page.
    3. Figure out where the differences are. The body class did show up as different when I ran the diff so you would have picked up that mistake right there.

    Finally, regarding this:

    function wp_head(){<link rel="stylesheet" href="http://sp.servicioswebmex.com/wp-includes/css/style.css"/>	<script type="text/javascript" src="http://sp.servicioswebmex.com/wp-includes/js/jquery/jquery.js"></script>	<script type="text/javascript" src="http://sp.servicioswebmex.com/wp-includes/css/clouds.js"></script>	<script type="text/javascript" src="http://sp.servicioswebmex.com/wp-includes/css/jquery-1.11.3.min.js"></script>}

    What is this? Do you know why it’s being included?

    <link rel="stylesheet" href="http://sp.servicioswebmex.com/wp-includes/css/style.css"/>

    jQuery is already a dependency of Vantage, you shouldn’t need it:

    <script type="text/javascript" src="http://sp.servicioswebmex.com/wp-includes/js/jquery/jquery.js">

    Is this URL correct? Don’t you mean to list the child theme folder here?

    <script type="text/javascript" src="http://sp.servicioswebmex.com/wp-includes/css/clouds.js"></script>

    jQuery is already a dependency of the parent theme, do you need this?

    <script type="text/javascript" src="http://sp.servicioswebmex.com/wp-includes/css/jquery-1.11.3.min.js"></script>

    I assume you left a part of this function out. You’d still need to add_action.

  7. 8 years, 11 months ago Andrew Misplon
    Hi, I Work Here

    That’s about as far as I can go on this :)

  8. 8 years, 11 months ago Andrew Misplon
    Hi, I Work Here

    Everything you’re looking for is in the Codex somewhere. For example, on registering scripts, please see: https://codex.wordpress.org/Function_Reference/wp_enqueue_script

    Hope that helps.

  9. 8 years, 11 months ago Jose AMezcua

    Hey Andrew!
    Thanks for all the great support with your guidance and some hardwork we got it working back again. The CSS is ok and the moving background with JS also.

    But now after all this we are getting this error:
    http://spacefood.activemarketing.mx/wp-content/uploads/2015/10/Error_Child_Theme.png

    Any idea what could be causing it?

    This is how we set up our child theme http://spacefood.activemarketing.mx/wp-content/uploads/2015/10/Carpeta_Child_Vantage.png

    This is what we have in the stylesheet css

    /*
     Theme Name:   Vantage Premium Child
     Theme URI:    https://siteorigin.com/theme/vantage/
     Description:  Vantage Premium Child Theme
     Author:       Alexander Aceves
     Author URI:   http://servicioswebemex.com
     Template:     Vantage Premium
     Version:      2.4.4
     Text Domain:  vantage-premimum-child
    */
    @import url("../vantage/style.css");
    

    IWe cant seem to find the error :o

    pleaaaase help!
    Thansk
    J

  10. 8 years, 11 months ago Andrew Misplon
    Hi, I Work Here

    Hi :)

    Please, check the functions.php file in your child theme. If you’re already enqueing the parent style.css file in there then you mustn’t import it in the child theme style.css file.

    To confirm, if in functions.php you enqueue the parent CSS, do not use this:

    @import url("../vantage/style.css");
    

    This line is incorrect:

     Template:     Vantage Premium
    

    It should just be “vantage”.

    Please, see our starter child theme here, everything you need is there: https://siteorigin.com/wp-content/uploads/2015/03/vantage-child-starter.zip

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More