Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1011784
    bezambar
    Participant

    Would it be possible to out a container above the masthead? I would like to display an accordion slider above the masthead by using the shortcode. What would be the best way to do this.

    #1012253
    Rad
    Moderator

    Hi there,

    Thanks for writing in.

    Yes, you can do that by adding this code to your child theme’s functions.php with your accordion shortcodes or container.

    add_action('x_after_site_begin', 'above_masthead_container');
    
    function above_masthead_container () {
    echo do_shortcode('<!--replace this content with your container or accordion shortcode-->');
    }

    Just replace this line <!--replace this content with your container or accordion shortcode-->

    Cheers!

    #1013567
    bezambar
    Participant

    Thanks, but will this add the slider on all pages or just specified pages.

    #1013935
    Prasant Rai
    Moderator

    Hello There,

    Above code will display content of shortcode in all pages across website.

    Thanks.

    #1016964
    bezambar
    Participant

    Would it be possible to specify the pages, or even just put it on the home page?

    #1017080
    Darshana
    Moderator

    Hi there,

    Use the following code instead.

    
    add_action('x_after_site_begin', 'above_masthead_container');
    
    function above_masthead_container () {
    	if ( is_page( 61 ) ) {
    		echo do_shortcode('[x_custom_headline type="center" level="h2" looks_like="h3" accent="true"]My Custom Headline[/x_custom_headline]');
    	}
    }
    

    Replace 61 with your page ID. Here’s how to locate page/post IDs (https://community.theme.co/kb/how-to-locate-post-ids/).

    Hope that helps.

    #1022950
    bezambar
    Participant

    thank you

    #1022986
    bezambar
    Participant

    One more question, how would i put it above the menu?

    #1023564
    Rue Nel
    Moderator

    Hello Again,

    If you want to put it above the menu, please find and replace this line:

    
    add_action('x_after_site_begin', 'above_masthead_container');

    And replace it with this code instead.

    
    add_action('x_before_view_global__navbar', 'above_masthead_container');

    We would loved to know if this has work for you. Thank you.

    #1024682
    bezambar
    Participant

    Nothing changed, my slider still seems to appear above the entire masthead.

    #1025273
    Rue Nel
    Moderator

    Hello There,

    To assist you better with this issue, would you mind providing us the url of your site with login credentials so we can take a closer look? This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.

    To do this, you can make a post with the following info:
    – Link to your site

    – WordPress Admin username / password

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

    Thank you.

    #1029135
    bezambar
    Participant
    This reply has been marked as private.
    #1029529
    Paul R
    Moderator

    Hi,

    We need your wordpress admin login or ftp login to be able to check on this.

    Thanks

    #1030414
    bezambar
    Participant

    ok you can use the same one now

    #1031280
    Lely
    Moderator

    Hello There,

    Did you mean that we can use the same credentials for FTP? I tried but I got the following error:

    530 Login authentication failed
    Error:	Critical error: Could not connect to server

    I want to check on which page you have implemented the code.

    
    add_action('x_before_view_global__navbar', 'above_masthead_container');
    function above_masthead_container () {
    	if ( is_page( 61 ) ) {
    		echo do_shortcode('[x_custom_headline type="center" level="h2" looks_like="h3" accent="true"]My Custom Headline[/x_custom_headline]');
    	}
    }

    Please provide your correct FTP credentials and the URL where you want to implement this.

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