-
AuthorPosts
-
April 1, 2015 at 4:59 pm #422021
Hi,
I need to insert an anchor (<div id = “myAnchor”> </ div>) just below the body tag on a page.
How can I do?This is a page where I incorporates a responsive plug.
I created a page template, and I inserted the code but it is under the header. And I wish it were over.
Thanks
_________________________________________________________________________________________
<?php
/*
Template Name: my template name
*/
/*
* un modele de page avec une ancre pour le catalogue responsive
*/global $avia_config;
/*
* get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory.
*/
get_header();if( get_post_meta(get_the_ID(), ‘header’, true) != ‘no’) echo avia_title();
?>
<div id=”myAnchor”></div>
<div class=’container_wrap container_wrap_first main_color <?php avia_layout_class( ‘main’ ); ?>’>
…April 2, 2015 at 9:32 am #422356Hi,
if I understand…
I have to put a code in the header, but just for one page (id=11) :
if page id = 11, then code <div id=”myAnchor”></div> just under de body tagSomeone can give this code, and the file ?
Because do not master PHP 5.Thanks
April 2, 2015 at 2:06 pm #422477Hi!
Thank you for using Enfold.
You can add this to the function.php file to insert the div at the very top of the main container:
add_action('ava_after_main_container','ava_after_main_container_mod'); function ava_after_main_container_mod() { if(is_page(11)) { echo "<div id='myAnchor'></div>"; } }Regards,
IsmaelMay 25, 2015 at 4:58 pm #449609This reply has been marked as private.May 25, 2015 at 7:26 pm #449687Hi!
Please go to Appearance > Editor and open Header.php file and find
<?php if("av-preloader-active av-preloader-enabled" === $preloader)and add your code as following right after opening of PHP tag
if(is_page(11)) { echo "<div id='myAnchor'></div>"; }Regards,
YigitMay 25, 2015 at 9:52 pm #449730Hi Yigit,
Perfect with your code :
<?php
if(is_page(11)) { echo “<div id=’shrAnchor’></div>”; }
?>
just under de body tag
Thanks -
AuthorPosts
- The topic ‘code under de body tag in a page’ is closed to new replies.
