Viewing 27 posts - 1 through 27 (of 27 total)
  • Author
    Posts
  • #845447

    Hi Enfold-

    I am using a WP Plugin for my instagram feed and it displays wherever I want it. I currently display it on the Home Page using “Code Block” in the Avia Layout Builder. I would like to display it at the very top of my home page, above the header. I cannot figure out how to get anything there that goes above the header. See private content for my examples.

    Is there any quick CSS code I can implement to put a “Code Block” appear above the header? Thank you!! Nicole

    #845453

    Hey wanderglow,

    Please add following code to Functions.php file in Appearance > Editor

    add_action('ava_after_main_container','ava_after_main_container_new');
    function ava_after_main_container_new(){
    ?>
    YOUR CODE GOES HERE
    

    Best regards,
    Yigit

    #848430

    Hi Yigit-

    Well, that caused me some issues as I must have pasted the code incorrectly though I pasted exactly as above but perhaps I should have added a / or something at the beginning? Now my theme is not working at all. See private content. You’ll be able to tell immediately upon visiting my website…. :(

    Please help. Thank you!

    Nicole

    #848453

    Hi Yigit (and Kriesi Team)-

    I’ve actually gotten my site working again by restoring a prior version. So we are back in business, so to speak. However…let’s try this again. Can you tell me where exactly in the Functions.php file to paste this code? Last time I obviously put it in the wrong place and it brought down my entire site. I am hoping to avoid that this time. :)

    In the Private Data that I previously sent, you can see the exact error message, if that is helpful.

    Thank you! Nicole

    #848527

    Hi,

    Please use the code as following

    add_action('ava_after_main_container','ava_after_main_container_new');
    function ava_after_main_container_new(){
    ?>
    YOUR CODE GOES HERE
    <?php
    }

    Sorry, there was a space in PHP closing tag. It should work fine now :)

    Best regards,
    Yigit

    #848827
    This reply has been marked as private.
    #848839
    This reply has been marked as private.
    #848844

    Hi!

    It throws an error on PHP code checker because PHP tags are missing. Once they are added, there is no error.
    Can you please post FTP and WP admin logins here privately so we can try adding the code?

    Regards,
    Yigit

    #848847

    sure! Got it. I didn’t realize that but figured it was something like that. Thank you!

    #849074

    Hi,

    It seems like you were adding the code to the top of the file. I added it to the bottom and it did not throw any errors. Please review your website :)

    Best regards,
    Yigit

    #849127

    Thanks Yigit! I see the code on the website, or at least the text. However, it appears to go underneath my header. Is it possible for it to go ABOVE it, like in the example I have provided in the private content? You see the Instagram Feed is the first thing on the page, directly at the top.

    Thank you!

    #849137

    Hi!

    In that case, i am sorry to say now but i think it would be the best if you used a child theme – http://kriesi.at/documentation/enfold/using-a-child-theme/, copy enfold/header.php file to your child theme and add your code manually right below Body tag.

    Best regards,
    Yigit

    #849216

    Hi Yigit- Thanks so much for that. I’ll get it added to a child theme then. Seems that is the best route for many reasons.

    Thanks for removing the code – I noticed that you did. Thank you!

    Best, Nicole

    #849518

    Hi Nicole,

    Yes, if you have some modification in files, it would be best to use the child theme since any customizations done in the parent theme will be lost during the theme update but with child theme it can be preserved. Glad that Yigit helped you and thanks for using Enfold :)

    Best regards,
    Nikko

    #857105

    Hi Enfold- I have my child theme set up and implemented now. Can you tell me what code to add to the enfold/header.php file? Previously, it was missing some { } or PHP tags, and I am not sure where to add those.

    Thanks for the help!

    #857578

    Hi wanderglow,

    Can you post in private the code you’re trying to add?

    Best regards,
    Victoria

    #857661

    I’ve posted it.

    #858044

    Hi,

    Are you sure the shortcode is correct?
    Before you paste the code please change

    this ’ to ' and the double quotes too

    .

    Best regards,
    Victoria

    • This reply was modified 7 years, 2 months ago by Victoria.
    #858670

    Thank you! I think we are almost there. However, maybe I am missing some php tags or something? See the code below + my website. My site isn’t crashing and the location of where I want the pictures to appear is correct…but the code is appearing, not the images. If I add opening and closing PHP tags, the line of code moves from above my header to below. I want it to be ABOVE.

    I am sure the shortcode (for instagram) is correct as I am using it on the home page of my website now, down at the bottom. I used the Code Block at the bottom of the home page and it works there. Thank you for your help!

    #859087

    Hi,

    I can see the “sb_instagram” images above the footer or after the main container. Is this fixed?

    Best regards,
    Ismael

    #859089

    Hi Ismael- No, that was already there. Please look at my website and see the text above the header. That is supposed to be the Instagram Feed. Please ignore the Instagram feed above the footer – that has been working correctly and I figured that out on my own. I am working on the HEADER now, per the prior chain of messages here. Thank you!

    #859499

    Hi,

    I see. Did you add the code in the functions.php file? Looks like you added it directly in the header.php file.

    Best regards,
    Ismael

    #859713

    Hi Ismael- I added it to the header.php file. Should it be added to the functions.php file instead?

    Thank you!
    Nicole

    #859847
    This reply has been marked as private.
    #859996

    Hi,

    I’m sorry for the late response. You should add the filter or code in the functions.php file, not the header.php file. It’s going to render the instagram shortcode right after the main container, just below the header. If you need to put something above the header, edit the header.php file then look for the following code.

    if(!$blank) //blank templates dont display header nor footer
    	{
    		 //fetch the template file that holds the main menu, located in includes/helper-menu-main.php
             get_template_part( 'includes/helper', 'main-menu' );
    
    	}
    

    Above that block of code, insert the instagram shortcode in combination with the do_shortcode function.

    echo do_shortcode("[Instagram-Feed]");
    

    Make sure that the code is inside the php opening tag.

    Best regards,
    Ismael

    #860284

    It works! It took a little playing around with it but it works now! Thank you so much!

    #860444

    Hi,

    Great! Let us know if you need anything else. :)

    Best regards,
    Ismael

Viewing 27 posts - 1 through 27 (of 27 total)
  • The topic ‘Seeking some code to add "Instagram Feed" above header’ is closed to new replies.