Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

How to animate this div like the others? WordPress

  • SOLVED

Hello I have a theme from themeforest that has some javascript movement in it.

I have added a div that contains an image and a link, however this div is showing on the homepage, I would like to hide it on the homepage but show on all other pages.

I would like to make this div animate with the same movement as the page load.

Please see the attached image for the link to my site, The button I would like animating is the register button that shows on the homepage.

Thank You

Answers (5)

2012-05-23

Arnav Joy answers:

Hi Ross,

I would like to help you for this , please send me ftp.

-Arnav


Ross Gosling comments:

Hello Arnav, I have sent you PM


Arnav Joy comments:

Hi Ross ,

Please check the site and let me know if there is any issue.


Arnav Joy comments:

Ross , Please check I have corrected the issue told by you.

2012-05-23

Romel Apuya answers:

Hi,

I can surely help you with this.

send me ftp and login details


cheers,


romel

2012-05-23

Nilesh shiragave answers:

If you set your home page as a static from Readings Settings at Settings->Reading in admin then you have to add following code to display div/html code just on home page



<?php if(!is_front_page()): ?>
<!-- Add Your Div Code here -->
<?php endif; ?>




Let me know your home page is set from readings settings or not?


Ross Gosling comments:

Thank you for you help, I tried your option but did not quite work.

2012-05-23

Agus Setiawan answers:

hope this help you :

replace this line : <strong><a href="http://YOURDOMAINNAME/register/" title="Register"><div id="registerbutton"></div></a></strong>

with this code :

<?php
if (!is_home() ) {
<a href="http://YOURDOMAINNAME/register/" title="Register"><div id="registerbutton"></div></a>
}
?>

or

use CURL function to detect is homepage or not :

<?php
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
?>

<?
$anuku=curPageURL();
if($anuku=='http://YOURDOMAINNAME/'){
echo '<a href="http://YOURDOMAINNAME/register/" title="Register"><div id="registerbutton"></div></a>';

}
?>


Ross Gosling comments:

Thank you for you help, I tried both your options but did not quite work.

2012-05-24

Pau answers:

If you added the div manually or directly into the file then change it to this:

<?php if( is_home() ) : ?>
your div code here
<?php endif; ?>