![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Too lazy to set a custom title
Industry Role:
Join Date: Dec 2006
Posts: 16,256
|
![]() hi looking for some help here!
I'm using this code to display something on the home page only, not on the category, posts, or archives pages. This is the code: <?php if(is_home() && $post==$posts[0] && !is_paged()) { ?> ADVERTISEMENT HERE <?php } ?> But when I use that I get this error: Fatal error: Call to undefined function is_home() Any help is much appreciated thanks!
__________________
I SELL ADULT BACKLINKS! Email: eroticweb>gmail SKYPE: gfybloggerz $$$$$ MAKE HUGE MONEY IN CAMS - CLICK HERE $$$$$ |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Aug 2010
Posts: 457
|
yes, you're using a function "is_home()" and "is_page()" in an equasion. I don't think you can do that.
__________________
![]() Bittie Bucks - Upto 70% Revshare - CCBill Cascading Program - 10% Webmaster Referral [email protected] - ICQ - 594415957 Need Content TRASHY CONTENT |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 | |
Confirmed User
Join Date: Dec 2005
Posts: 271
|
Quote:
The problem you have is that the functions are not defined. (You need to have the functions included in the php file). |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Too lazy to set a custom title
Industry Role:
Join Date: Dec 2006
Posts: 16,256
|
You have the code? Pls copy andpaste thx
__________________
I SELL ADULT BACKLINKS! Email: eroticweb>gmail SKYPE: gfybloggerz $$$$$ MAKE HUGE MONEY IN CAMS - CLICK HERE $$$$$ |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: Dec 2005
Posts: 271
|
Why would I have your code?
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Pay It Forward
Industry Role:
Join Date: Sep 2005
Location: Yo Mama House
Posts: 77,061
|
__________________
TRUMP 2025 KEKAW!!! - The Laken Riley Act Is Law! DACA ENDED - SUPPORT AZ HCR 2060 52R - email: brassballz-at-techie.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Industry Role:
Join Date: May 2003
Posts: 3,765
|
is it near the top of the page? maybe you're using it before the functions are called in
__________________
flexx [dot] aeon [at] gmail |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 | |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,339
|
Quote:
Code:
<?php if (is_home() || !is_archive() || !is_paged() || !is_category() || !is_tag() || !is_single()) {?> ad here. <?php } ?>
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
Too lazy to set a custom title
Industry Role:
Join Date: Jun 2005
Location: 127.0.0.1
Posts: 27,047
|
Quote:
![]()
__________________
Make Money
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Confirmed User
Join Date: Dec 2005
Posts: 271
|
That code is disgusting
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Too lazy to set a custom title
Join Date: Jan 2002
Location: Holland
Posts: 9,870
|
wont solve : function not found.
__________________
Don't let greediness blur your vision | You gotta let some shit slide icq - 441-456-888 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
the guy
Industry Role:
Join Date: Apr 2005
Posts: 764
|
is_home() isn't a native php function. It couldn't ever be, and i'm not even going to begin to explain why.
However, At some point, it's probably been written in some script you previously had. Are you defining this function elsewhere in your codebase? If so, you'll need to use include() to pull the file that defines the function into the script you're working with. It's kinda like writing something like: Code:
<? fucking(); ?> Code:
<? function fucking() { echo "do the bartman"; } ?> Code:
<? include('includes/func.fucking.php'); fucking(); ?> Code:
<? function fucking() { echo "do the bartman"; } fucking(); ?>
__________________
If you won't feel as good, I won't feel as cheap. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
Confirmed User
Industry Role:
Join Date: Sep 2010
Posts: 649
|
PHP Code:
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 | |
Confirmed User
Industry Role:
Join Date: Aug 2001
Posts: 832
|
Quote:
Code:
<?php if($_SERVER['REQUEST_URI'] == '/') { echo 'Adcode here'; } ?> |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,339
|
where are you using the code?
i added it to a current theme, and it worked like a charm.
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 | |
Too lazy to set a custom title
Industry Role:
Join Date: Dec 2006
Posts: 16,256
|
Quote:
Do i need to add something in functions.php or something? Im still getting Fatal error: Call to undefined function is_home()
__________________
I SELL ADULT BACKLINKS! Email: eroticweb>gmail SKYPE: gfybloggerz $$$$$ MAKE HUGE MONEY IN CAMS - CLICK HERE $$$$$ |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 | |
Confirmed User
Industry Role:
Join Date: Dec 2004
Location: Denver
Posts: 6,559
|
Quote:
What I don't get is why you need all the other statements. If it is the home page, then when or why would archive, paged, category, tag, or single ever return? Seems odd to me (though I don't use wordpress a lot).
__________________
![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#18 |
Confirmed User
Industry Role:
Join Date: Dec 2004
Location: Denver
Posts: 6,559
|
Now that I think about it, wouldn't
Code:
<?php if (is_home() || !is_archive() || !is_paged() || !is_category() || !is_tag() || !is_single()) {?> ad here. <?php } ?> [b]Show the ad if: • It's the home page • Or if it's not the archive • Or if it's not paged • Or if it's not a category • Or if it's not a tag • Or if it's not a single.[b] So it would display the ad on any page that wasn't the archive for instance. Because with all the "OR" double pipes, only one of those circumstances needs to be true for the ad to display.
__________________
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#20 | |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,339
|
Quote:
using that code if i view a category or tag page or full post, it doesnt show the ad. only on the home, not any paged page2,page3, etc.
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#21 |
Too lazy to set a custom title
Industry Role:
Join Date: Dec 2006
Posts: 16,256
|
An external php file and im calling it through php include
__________________
I SELL ADULT BACKLINKS! Email: eroticweb>gmail SKYPE: gfybloggerz $$$$$ MAKE HUGE MONEY IN CAMS - CLICK HERE $$$$$ |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#22 |
the guy
Industry Role:
Join Date: Apr 2005
Posts: 764
|
you are an idiot.
__________________
If you won't feel as good, I won't feel as cheap. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#24 | |
Confirmed User
Industry Role:
Join Date: Dec 2004
Location: Denver
Posts: 6,559
|
Quote:
Why not simply use: Code:
<?php if (is_home()) {?> ad here. <?php } ?> Because using Code:
<?php if (is_home() || !is_archive() || !is_paged() || !is_category() || !is_tag() || !is_single()) {?> ad here. <?php } ?> Code:
<?php if (is_home()) {?> ad here. <?php } ?> Code:
<?php if (!is_archive()) {?> ad here. <?php } ?> Maybe I'm not explaining myself, but I just don't understand the point of having alllll those extra OR statements?
__________________
![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#25 | |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,339
|
Quote:
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#26 |
Confirmed User
Industry Role:
Join Date: Dec 2004
Location: Denver
Posts: 6,559
|
weird... I suppose it'll all make sense if I ever use wordpress again and see the code and the way the system functions.
__________________
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |