Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #668270

    helloeng
    Participant

    Hello

    I am getting this error lately:

    Error: Please fix your theme to make plugins work correctly: Go to the theme Editor and insert <?php wp_head(); ?> just before the </head> line of your theme’s header.php file.

    I deactivated all non X plugins and then one-by-one reactivated them. It seems the error is caused by a plugin, ‘Ultimate Social Media Plus’. When it’s active I get the error.

    I also get an error about the topbar.php in my Cpanel error file:
    [17-Nov-2015 11:20:06 UTC] PHP Fatal error: Call to undefined function pll_the_languages() in /home/helloeng/public_html/wp-content/themes/x-child/framework/views/global/_topbar.php on line 21

    This is line 21: <?php pll_the_languages();?>

    It looks like it relates to Polylang, but I de- and reactivated Polylang and it did not appear to have anything to do with the error.

    I’m using X, currently Icon, the only custom CSS I have at the moment is:
    .x-topbar .x-social-global{
    display:none;
    }
    .lang-item {
    display: inline;
    }
    .lang-item {
    list-style: none;
    }

    Would appreciate some help.

    #668290

    Paul R
    Moderator

    Hi,

    Thanks for writing in!

    wp_head(); is already added in our theme header.

    You can check the file wp-content/themes/x/framework/views/global/_header.php Line number 16

    It sounds like you might be having an issue with a third party plugin or script. Regretfully, we cannot provide support for third party plugins or scripts as our support policy in the sidebar states due to the fact that there is simply no way to account for all of the potential variables at play when using another developer’s plugin or script. Because of this, any questions you have regarding setup, integration, or troubleshooting any piece of functionality that is not native to X will need to be directed to the original developer.

    Thank you for your understanding.

    #668350

    helloeng
    Participant

    Yes I see it’s already in the header.

    What about the <?php pll_the_languages();?> in the X _topbar.php? Is this code correct? I mean I got the language switcher code in the topbar.php from X support staff. So why would it give me an error with “undefined” function?

    PHP Fatal error: Call to undefined function pll_the_languages() in /home/helloeng/public_html/wp-content/themes/x-child/framework/views/global/_topbar.php on line 21

    From an X perspective, there is no reason why <?php pll_the_languages();?> should cause an error, right?

    <?php

    // =============================================================================
    // VIEWS/GLOBAL/_TOPBAR.PHP
    // —————————————————————————–
    // Includes topbar output.
    // =============================================================================

    ?>

    <?php if ( x_get_option( ‘x_topbar_display’, ” ) == ‘1’ ) : ?>

    <div class=”x-topbar”>
    <div class=”x-topbar-inner x-container max width”>
    <?php if ( x_get_option( ‘x_topbar_content’ ) != ” ) : ?>
    <p class=”p-info”><?php echo x_get_option( ‘x_topbar_content’ ); ?></p>
    <?php endif; ?>
    <?php x_social_global(); ?>

    <ul class=”language-switcher right”>
    <?php pll_the_languages();?>

    </div>
    </div>

    <?php endif; ?>

    #668364

    Christopher
    Moderator

    Hi there,

    Please provide us with URL of thread which provided language switcher code.

    Thanks.

    #668386

    helloeng
    Participant
    #668416

    Thai
    Moderator

    Hi There,

    Please update your code to this:

    <?php
    
    // =============================================================================
    // VIEWS/GLOBAL/_TOPBAR.PHP
    // -----------------------------------------------------------------------------
    // Includes topbar output.
    // =============================================================================
    
    ?>
    
    <?php if ( x_get_option( 'x_topbar_display', '' ) == '1' ) : ?>
    
      <div class="x-topbar">
        <div class="x-topbar-inner x-container max width">
          <?php if ( x_get_option( 'x_topbar_content' ) != '' ) : ?>
          <p class="p-info"><?php echo x_get_option( 'x_topbar_content' ); ?></p>
          <?php endif; ?>
          <?php x_social_global(); ?>
    
          <ul class="language-switcher right">
          	<?php 
    	      	if(function_exists('pll_the_languages')){
    	      		pll_the_languages();
    	      	}
          	?>
          </ul>
    
        </div>
      </div>
    
    <?php endif; ?>

    Hope it helps 🙂

    #668654

    helloeng
    Participant

    I changed the file and will see if that gets rid of the php error:
    PHP Fatal error: Call to undefined function pll_the_languages() in /home/helloeng/public_html/wp-content/themes/x-child/framework/views/global/_topbar.php on line 21

    Thanks!

    #668672

    helloeng
    Participant

    PS: I’m still getting this one: Error: Please fix your theme to make plugins work correctly: Go to the theme Editor and insert <?php wp_head(); ?> just before the </head> line of your theme’s header.php file.

    I contacted the plugin people about it, hopefully they have an idea what’s causing it.

    I hope that the <?php wp_head(); ?> error and the undefined function pll_the_languages() error are not related.

    #668701

    Thai
    Moderator

    Hi There,

    In this case, would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link login to your site
    – WordPress Admin username / Password
    – FTP Account

    Don’t forget to select Set as a private reply. This ensures your information is only visible to our staff.

    Thanks.

    #668728

    helloeng
    Participant
    This reply has been marked as private.
    #668809

    Jade
    Moderator

    Hi there,

    Kindly set the user as an admin user and please provide us with your FTP details so that we can check this further. Thank you.

    #668854

    helloeng
    Participant
    This reply has been marked as private.
    #668965

    Jade
    Moderator

    Hi there,

    Yes, that will do. Thank you.

    #668981

    helloeng
    Participant
    This reply has been marked as private.
    #669167

    Friech
    Moderator

    Hi There,

    Thanks for the credentials. But as you already know this is an Ultimate Social Media plugin issue. Regretfully, we cannot provide support for third party plugins due to the fact that there is simply no way to account for all of the potential variables at play when using another developer’s plugin or script. Because of this, any questions you have regarding setup, integration, or troubleshooting any piece of functionality that is not native to X will need to be directed to the original developer.

    Or you could use the X native Social Sharing element.

    Thank you for your understanding.