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

    GoWall
    Participant
    This reply has been marked as private.
    #282650

    Christopher
    Moderator

    Hi there,

    Please remove it from php file and place it under Customize -> Custom -> CSS.

    Thanks,

    #283072

    GoWall
    Participant
    This reply has been marked as private.
    #283342

    Nabeel A
    Moderator

    Hi again,

    Have you activated the X-Child-Theme? The code you paste in child theme’s functions.php file won’t work until the child theme is activated. Please make sure it is currently active. Then paste the PHP code (provided in https://community.theme.co//forums/topic/adding-buttons-to-topbarnavbar/#post-282355) only in your child theme’s functions.php at the bottom of the file. Please do not add anything in parent theme.

    Regarding your footer issue please add the following code in your Customizer via Appearance > Customize > Custom > CSS:

    .x-colophon.bottom .x-nav li {
      float: left;
      list-style-type: none;
      padding: 0 30px 0 34px;
    }

    Let us know how this goes!

    #283430

    GoWall
    Participant

    Sadly, it’s not helped; the website is still quite broken (although it didn’t crash it this time). I followed your instructions and activated my child theme. Then I added the following to the functions.php file:

    `// Add button to nav menu
    // =============================================================================
    function x_button_nav_item( $items, $args ) {

    if ( $args->theme_location == ‘primary’ ) {
    $items .= ‘<li class=”menu-item x-menu-item x-menu-item-button”>’
    . ‘<span>’
    . do_shortcode(‘[button shape=”rounded” size=”regular” float=”inline” info=”none” info_place=”top” info_trigger=”hover” href=”https://acceptance.gowall.com/#/login” class=”nav-button”]Login[/button]’)
    . ‘</span>’
    . ‘‘;
    }

    return $items;

    }
    add_filter( ‘wp_nav_menu_items’, ‘x_button_nav_item’, 10000, 2);
    // =============================================================================

    if( ! function_exists(‘x_button_nav_item’) ) {
    function x_button_nav_item( $items, $args ) {

    if ( $args->theme_location == ‘primary’ ) {
    $items .= ‘<li class=”menu-item x-menu-item x-menu-item-button”><span>Square Button</span>‘;
    }

    return $items;

    }
    add_filter( ‘wp_nav_menu_items’, ‘x_button_nav_item’, 10000, 2);
    }’

    The site is test-portal.gowall.com, and all the parent theme files are untouched (including functions.php)

    #283760

    Rad
    Moderator

    Hi,

    In that 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 to your site
    – WordPress Admin username / password
    – FTP credentials

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

    Thanks!

    #284054

    GoWall
    Participant
    This reply has been marked as private.
    #284254

    Zeshan
    Member
    This reply has been marked as private.
    #284770

    GoWall
    Participant
    This reply has been marked as private.
    #285325

    Rad
    Moderator

    Hi there,

    Before we go deeply into tweakings, maybe let us fix the layout issue when switching to child theme. The provided php code should be added at child theme’s functions.php so it’s only logical to solve the child theme issues first 🙂

    First, while your parent theme is active.
    1. Please export your customizer settings at Admin > Addons > Customizer Manager.
    2. List all your widgets and menu (later you will have to re-add them if they are missing).
    3. Edit your child theme’s functions.php and make sure that this line of code is present.

    add_filter( 'x_enqueue_parent_stylesheet', '__return_true' );

    4. Activate your child theme
    5. Import your customizer settings you previously exported.
    6. Re-add your menu and widgets if missing.

    Then let us know any result. Please disable your custom templates from your child theme if you have older copies.

    Thanks!

    #285412

    GoWall
    Participant

    Followed your instructions, which didn’t change anything (layout was still messed up after activating child theme). I deleted the php code for the navbar button and search, but it only made the site look a little less crazy (only the add_filter( 'x_enqueue_parent_stylesheet', '__return_true' ); line appears as text on the site now).

    #285761

    Zeshan
    Member

    Hi there,

    Your child theme’s functions.php file was missing <?php at the start, so I just added it and the layout looks good now. Please confirm.

    Thanks.

    #286244

    GoWall
    Participant

    Yes, that got the website working; HOWEVER, none of the php code you’ve provided me with works! it all crashes my site 🙁

    #287041

    Rad
    Moderator

    Hi there,

    In that case, I’d like to see the actual errors it throws. Would mind providing a guide of how we can get in at your site without FTP?

    Or maybe provide screenshots of error and the actual source code added.

    Thanks!

    #289188

    GoWall
    Participant

    There is no error; only the site crashes soon after making those modifications to the functions.php file. Is there any chance you could just go in with the WP credentials and see why this is happening? This is really frustrating and I’m losing a lot of valuable time with non-functional code that you have provided me…