eva-MyClientIsRich
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Issue with is_home() condition on WP 3.3Here is the index.php full code : https://pastebin.com/q2wpQTqF
And here is content.php : https://pastebin.com/RkhsA3jx
I already tried with all my plugins desactivated. Looks like they do not play a role in this issue.
With default Twenty Eleven theme, my condition works in
content.php
I’m looking at my code, trying to see anything different from Twenty Eleven default theme (as I mentioned, my own theme is based on this theme so it is very similar) which would break theis_home()
condition…Thanks for the kind help, I’m afraid I can’t paste the link to the website, it is not public yet.
Forum: Themes and Templates
In reply to: Issue with is_home() condition on WP 3.3Yes, the result is
[is_home] => 1
on index.phpJust to try, I pasted this in content.php, and it is not set there :
[is_home] =>
Forum: Themes and Templates
In reply to: Issue with is_home() condition on WP 3.3in
content.php
(it is a theme based on twenty eleven), which is included inindex.php
.Forum: Themes and Templates
In reply to: Issue with is_home() condition on WP 3.3I’m using
is_home()
on the blog homepage, not on a static page. And that’s the blog which is configured as the home page. I also thought aboutis_front_page()
but double checked that my blog was the homepage. That’s weird.Forum: Themes and Templates
In reply to: Issue with is_home() condition on WP 3.3Hi ! Thanks for trying to help !
Tried both solutions, and the same issue continues…To be sure, I tried to use a regular php function, to get the current page (homepage) url and see if it matches my $homeUrl, and it works. The
is_home()
function is still not working, even when I reset queries… Until I find a solution aboutis_home()
, I’ll use my function (which does the same).<?php $homeUrl = "https://mysite.com/"; $myUrl = "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; if($myUrl == $homeUrl && has_tag(array('place1', 'place2', 'place5'))) { the_post_thumbnail('home-smallpost-thumbnail'); } else{ the_post_thumbnail('home-bigpost-thumbnail'); } ?>
Related question : are we allowed to use several times
is_home()
on one page (I use it once in header.php and was trying to use it in content.php) ? I read somewhere that it may cause some troubles… (I think it should not).