-
AuthorPosts
-
August 29, 2017 at 9:08 pm #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
August 29, 2017 at 9:34 pm #845453Hey 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,
YigitSeptember 6, 2017 at 2:38 am #848430Hi 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
September 6, 2017 at 7:26 am #848453Hi 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
September 6, 2017 at 10:46 am #848527Hi,
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,
YigitSeptember 6, 2017 at 8:39 pm #848827This reply has been marked as private.September 6, 2017 at 9:10 pm #848839This reply has been marked as private.September 6, 2017 at 9:19 pm #848844Hi!
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,
YigitSeptember 6, 2017 at 9:32 pm #848847sure! Got it. I didn’t realize that but figured it was something like that. Thank you!
September 7, 2017 at 12:02 pm #849074Hi,
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,
YigitSeptember 7, 2017 at 3:21 pm #849127Thanks 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!
September 7, 2017 at 3:38 pm #849137Hi!
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,
YigitSeptember 7, 2017 at 8:26 pm #849216Hi 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
September 8, 2017 at 10:25 am #849518Hi 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,
NikkoSeptember 26, 2017 at 7:31 pm #857105Hi 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!
September 27, 2017 at 4:10 pm #857578Hi wanderglow,
Can you post in private the code you’re trying to add?
Best regards,
VictoriaSeptember 27, 2017 at 6:22 pm #857661I’ve posted it.
September 28, 2017 at 1:43 pm #858044Hi,
Are you sure the shortcode is correct?
Before you paste the code please changethis ’ to ' and the double quotes too
.
Best regards,
Victoria- This reply was modified 7 years, 2 months ago by Victoria.
September 30, 2017 at 7:10 am #858670Thank 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!
October 2, 2017 at 6:32 am #859087Hi,
I can see the “sb_instagram” images above the footer or after the main container. Is this fixed?
Best regards,
IsmaelOctober 2, 2017 at 6:34 am #859089Hi 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!
October 3, 2017 at 8:29 am #859499Hi,
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,
IsmaelOctober 3, 2017 at 6:19 pm #859713Hi Ismael- I added it to the header.php file. Should it be added to the functions.php file instead?
Thank you!
NicoleOctober 4, 2017 at 1:08 am #859847This reply has been marked as private.October 4, 2017 at 8:38 am #859996Hi,
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,
IsmaelOctober 4, 2017 at 7:52 pm #860284It works! It took a little playing around with it but it works now! Thank you so much!
October 5, 2017 at 6:28 am #860444 -
AuthorPosts
- The topic ‘Seeking some code to add "Instagram Feed" above header’ is closed to new replies.