btw. I tried also:
<?php if ( (is_front_page();) || (is_page(array(582));) || (is_paged() == 'false') ) { ?>
<div>Something to include</div>
<?php } ?>
And it’s also not working! π
If you describe in words what you are trying to accomplish it might make it easier for others to assist.
Just about to do it… so here:
IF I’m on a home page OR on specific page (but not on its paged pages) then include something, if not, just forget it π
Hope this is understandable.
Thanks for helping out.
ps. did I mention, I’m just learning and probably making stu**d mistakes…
Assuming you have is_front_page() is what you want…
<?php
if ( is_front_page() || is_page('582') ) { ?>
<div>Something to include</div>
<?php } ?>
See Conditional Tags
It still refuses to work!
– I checked if cache is enabled, but not. Removed cache instructions from config file, and disabled cache plugin.
– I tried also variation <?php if ( is_home() || is_page('holiday-news') ) { ?> but that also does not yield results…
Any other ideas?
I’m using this code within sidebar if that has anything to do with it.
Could be something else messing with the query variables so put <?php wp_reset_query(); ?> right before your if statement to see if that resolves it.
Thanks Michael, that done the trick π
I was going crazy already…
Continued…. I still need the last bit.. if the page is paged then don’t show it!
How do I properly say “if it is not paged”?
Something like: <?php if ( is_front_page() || is_page('582') && !$paged ) { ?>
In words:
If it’s front page or page 582 but not paged …
I managed to do it this way:
<?php if ( is_front_page() || is_page(‘582’) ) { ?>
<?php if ( !(is_paged()) ) { ?>
<div>Something to include</div>
<?php } ?>
<?php } ?>
Is there a nicer way?
Sorry I forgot the paged thing but something like:
<?php if ( (is_front_page() || is_page('582')) && !is_paged() ) { ?>
or even
<?php if ( (is_front_page() || is_page('582')) && empty($paged) ) { ?>