Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1335659
    kirk74
    Participant

    Hi team,

    I created a site a year or two ago using X and have had no issues with it .. but the client just contact me to say there is an error .. and there sure is .. When I look at the home page (or any page) – it is scrambled, just lines of code coming up.

    I looked into wp-admin, and it let me go straight there, everything looks fine in there.. and when I Linked to the site from Dashboard it is perfect.

    This is so strange I can’t see what would have happened.

    I really need urgent help please thank you so much. (I have noticed that it is inviting updating to 4.7.1, but I can’t imagine that this would cause such a big error).

    My first fear was has he been hacked? But since it all looks fine in the Dashboard I don;t think so ..

    I will send log in privately

    Thank you! 🙂

    #1335660
    kirk74
    Participant
    This reply has been marked as private.
    #1336071
    Nico
    Moderator

    Hi There,

    Thanks for writing in.

    Upon checking your site, could not see any problems. Would you mind sharing us a screenshot of the concern issues.

    Let us know how it goes.

    Thanks.

    #1336335
    kirk74
    Participant

    Hello, thanks very much .. I was just hopping on here to update the thread and say that it was actually a plugin conflict .. it wasn’t hacked after all.

    Just for my learning / future refernce though, I would love your opinion because what happened was really strange…

    1 –
    I worked out that the plugin with the conflict was CodeStyling Localisation (I can’t actually recall ever installing that, but I did design the site a while ago and have left it with the client to do post updates ever since, so it’s possible I did install it and forgot this…this is an overseas client so there was need for language conversions, so perhaps I installed it at some point .. client says he didn’t install it)

    2 –
    I disabled the plugin, and the site came back, (sort of!)… the scrambling went away, it was showing the content, but the CSS wasn’t rendering properly…

    3 –
    it was still perfect when I was logged in and accessing the site via the Dashboard .. so from there I used Developer Tools to find the correct CSS content, located the path for this CSS file (icon.css) … so I looked in FTP client and sure enough found that that CSS file was not in the correct place .. so I recreated this CSS from Developer Tools, and put it in the correct place on the server… and all was perfect again

    4 –
    So, what I don’t understand, is if that icon.css file was NOT there, how did the site render correctly while I was logged in..? When I was logged and in Developer tools I could see the CSS file and copy and paste its content .. it was almost like there was a second version of the whole website folder on the sever, one for while logged in and one for while not logged in .. but this wouldn’t make sense, would it??

    5 –
    And what I also don’t understand, is what would have made that CSS file “move” and therefore need to be recreated .. the file it was needing was meant to be in x/framework/css/site/stacks/icon.css .. and it wasn;t there after this error occurred.. but it must have been there when the site operating normally .. (and also it was somehow “there” when I was logged in ..) .. could a plugin make a core css file “move” like that..

    6 –
    What i also strange is why the plugin suddenly caused these errors.. because nothing new had been done to the site.. it hadn’t been updated at that point, no-one had even entered a post on it for several days … if that plugin was installed ages ago with no issues I find it odd that without doing any updates it would suddenly cause such a massively critical error like that..

    It’s good that it is sorted now, but I still feel really baffled by the whole thing .. my ISP thought it was hacked, and told me this, but we couldn’t see any evidence of viruses or tampered files .. this is why I started looking at the plugins and eventually work this out..

    I would love to know your expert option on this so I can learn and if something like this happens again (hopefully NOT!) I won’t need to bother you as I’ll understand it better. 🙂

    Thank you so much!

    #1336376
    Christian
    Moderator

    Hey there,

    Please check if you have this code in your child theme’s functions.php

    add_filter( 'x_enqueue_parent_stylesheet', '__return_true' );

    If not, you’re using the old child theme system. Adding that code in your functions.php (recommended) or updating the path in style.css will fix the layout issue.

    Other issues you faced sounds like it was caused by the third party plugin and caching.

    Thanks.

    #1336404
    kirk74
    Participant

    the layout is fine now because I added the icon.css file … but are you saying if I had that line of code then I wouldn’t have needed to do that hack?
    thx

    #1336413
    kirk74
    Participant

    sorry where am i looking for the child theme? I have a folder in themes/x/x-child-icon

    I looked at the functions folder there.. is that where you meant me to go?

    Cos I thought that in more recent versions of X there was just one child theme folder now.. not the ones specific to the stack..? Maybe I am remembering that wrong…

    (I am up to date in my automatic updates)

    Anyway, in that file I don;t have that line of code .. so do I add it to the bottom of the code?

    This is the code I have:

    THX!

    <?php
    
    // =============================================================================
    // FUNCTIONS.PHP
    // -----------------------------------------------------------------------------
    // Overwrite or add your own custom functions to X in this file.
    // =============================================================================
    
    // Entry Meta - Adding Author Name next to the Date.
    // =============================================================================
    
    if ( ! function_exists( 'x_icon_entry_meta' ) ) :
      function x_icon_entry_meta() {
          
        $author = sprintf( '<span><i class="x-icon-pencil"></i> Autor: <a href="%1$s">%2$s</a></span>',
          get_author_posts_url( get_the_author_meta( 'ID' ) ),
          get_the_author()
          
        );
    
        $date = sprintf( '<span><time class="entry-date" datetime="%1$s">%2$s</time></span>',
          esc_attr( get_the_date( 'c' ) ),
          esc_html( get_the_date() )
        );
    
           $categories        = get_the_category();
          $separator         = ', ';
          $categories_output = '';
          foreach ( $categories as $category ) {
            $categories_output .= '<a href="'
                                . get_category_link( $category->term_id )
                                . '" title="'
                                . esc_attr( sprintf( __( "Pogledajte sve članke u: &ldquo;%s&rdquo;", '__x__' ), $category->name ) )
                                . '"><i class="x-icon-bookmark" data-x-icon=""></i> '
                                . $category->name
                                . '</a>'
                                . $separator;
          }
    
          $categories_list = sprintf( '<span>%s</span>',
            trim( $categories_output, $separator )
          );
          
          
        if ( x_does_not_need_entry_meta() ) {
          return;
        } else {
          printf( '<p class="p-meta">%1$s %2$s %3$s</p>',
            $date,
            $author,
            $categories_list
          );
        }
    
      }
    endif;
    
    // Sharing Buttons on Blog Posts
    // =============================================================================
    
    function share_for_posts( $content ) {
      if ( is_singular('post') ) {
        echo do_shortcode('[share title="Podelite ovaj članak" facebook="true" twitter="true" google_plus="true" linkedin="true" pinterest="true" reddit="true" email="true"]');
      }
    }
    
    add_action('x_before_the_content_end', 'share_for_posts');
    
    function exclude_category_home( $query ) {
    if ( $query->is_home ) {
    $query->set( 'cat', '-30' );
    }
    return $query;
    }
    
    add_filter( 'pre_get_posts', 'exclude_category_home' );
    
    add_filter( 'pre_get_posts', 'exclude_category_home' );
    #1336464
    Paul R
    Moderator

    Hi,

    Please add this code after <?php

    add_filter( 'x_enqueue_parent_stylesheet', '__return_true' );

    Hope that helps.

  • <script> jQuery(function($){ $("#no-reply-1335659 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>