cblock
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Admin “edit” post content alignment is centeredthanks esmi….it was a plugin!
Forum: Fixing WordPress
In reply to: is_page not “completely” working@ apljdi;
correction
…WP is not recognizing the || is_page (‘arts-entertainment’) to be true…
Yes, you have the right idea, but the arts-entertainment condition returns true for all cases except for the || is_page (‘arts-entertainment’) – that’s where i test to see if the current page is the “Arts & Entertainment” page; in such a case include the nav-ent.php else continue
Forum: Fixing WordPress
In reply to: is_page not “completely” workingNo replies yet huh?
Well im not one to stop trying….oddly enough after further investigations i found that the following code produced the results i wanted, but im sure that this is a sloppy hack.Any one know why this works…from my limited understanding, it would seem to me that WP is not recognizing the || is_page (‘arts-entertainment’) to be false. as stated before changing the is_page() argument…results true. I tried using the page ID (577) as the argument for is_page(), but still returns false. After further testing, i deduced that “somehow?!?” WP thinks that the Arts & Entertainment page is a child of the ‘news’ category (13)…thus the following sloppy hack
if ( in_category(‘news’) || post_is_in_descendant_category( 13 )) {
if ( is_page(577)){
include ‘includes/nav-ent.php’;
}
else
include ‘includes/nav-home.php’;
}was used to replace the first condition in the code from the prev post.
You know how coding is sometimes….”just make it work”, even when we know its just a quick fix, hard code hack…just looking for any clarity on this issue.
Forum: Fixing WordPress
In reply to: if is a page, or a child of a page, or in a category (a solution)i am having a similar problem:
My conditional statement works for all cases except arts-entertainment page. Below is my code, any help would be appreciated.===================
<?php
if ( in_category(‘news’) || post_is_in_descendant_category( 13 ) ) {
include ‘includes/nav-home.php’;
}
elseif ( in_category(‘business’) || post_is_in_descendant_category( 14 ) || is_page(‘business’)) {
include ‘includes/nav-bus.php’;
}
elseif ( in_category(‘arts-entertainment’) || post_is_in_descendant_category( 17 ) || is_page(‘arts-entertainment’)) {
include ‘includes/nav-ent.php’;
}
elseif ( in_category(‘living’) || post_is_in_descendant_category( 19 ) || is_page(‘living’)) {
include ‘includes/nav-liv.php’;
}
elseif ( in_category(‘opinion’) || post_is_in_descendant_category( 18 ) || is_page(‘opinion’)) {
include ‘includes/nav-opn.php’;
}
elseif ( in_category(‘sports’) || post_is_in_descendant_category( 20 ) || is_page(‘sports’)) {
include ‘includes/nav-spt.php’;
}
else {
include ‘includes/nav-home.php’;
}
?>==================
FYI: The idea is to use a different color for navigation for each page in the conditional statement.Forum: Themes and Templates
In reply to: is_page not working for “posts” pagei am having a similar problem:
My conditional statement works for all cases except arts-entertainment page. Below is my code, any help would be appreciated.===================
<?php
if ( in_category(‘news’) || post_is_in_descendant_category( 13 ) ) {
include ‘includes/nav-home.php’;
}
elseif ( in_category(‘business’) || post_is_in_descendant_category( 14 ) || is_page(‘business’)) {
include ‘includes/nav-bus.php’;
}
elseif ( in_category(‘arts-entertainment’) || post_is_in_descendant_category( 17 ) || is_page(‘arts-entertainment’)) {
include ‘includes/nav-ent.php’;
}
elseif ( in_category(‘living’) || post_is_in_descendant_category( 19 ) || is_page(‘living’)) {
include ‘includes/nav-liv.php’;
}
elseif ( in_category(‘opinion’) || post_is_in_descendant_category( 18 ) || is_page(‘opinion’)) {
include ‘includes/nav-opn.php’;
}
elseif ( in_category(‘sports’) || post_is_in_descendant_category( 20 ) || is_page(‘sports’)) {
include ‘includes/nav-spt.php’;
}
else {
include ‘includes/nav-home.php’;
}
?>==================
FYI: The idea is to use a different color for navigation for each page in the conditional statement.Forum: Fixing WordPress
In reply to: is_page not workingi am having a similar problem:
My conditional statement works for all cases except arts-entertainment page. Below is my code, any help would be appreciated.===================
<?php
if ( in_category(‘news’) || post_is_in_descendant_category( 13 ) ) {
include ‘includes/nav-home.php’;
}
elseif ( in_category(‘business’) || post_is_in_descendant_category( 14 ) || is_page(‘business’)) {
include ‘includes/nav-bus.php’;
}
elseif ( in_category(‘arts-entertainment’) || post_is_in_descendant_category( 17 ) || is_page(‘arts-entertainment’)) {
include ‘includes/nav-ent.php’;
}
elseif ( in_category(‘living’) || post_is_in_descendant_category( 19 ) || is_page(‘living’)) {
include ‘includes/nav-liv.php’;
}
elseif ( in_category(‘opinion’) || post_is_in_descendant_category( 18 ) || is_page(‘opinion’)) {
include ‘includes/nav-opn.php’;
}
elseif ( in_category(‘sports’) || post_is_in_descendant_category( 20 ) || is_page(‘sports’)) {
include ‘includes/nav-spt.php’;
}
else {
include ‘includes/nav-home.php’;
}
?>==================
FYI: The idea is to use a different color for navigation for each page in the conditional statement.Forum: Fixing WordPress
In reply to: conditional IF ELSE statements not workingi am having a similar problem:
My conditional statement works for all cases except arts-entertainment page. Below is my code, any help would be appreciated.===================
<?php
if ( in_category(‘news’) || post_is_in_descendant_category( 13 ) ) {
include ‘includes/nav-home.php’;
}
elseif ( in_category(‘business’) || post_is_in_descendant_category( 14 ) || is_page(‘business’)) {
include ‘includes/nav-bus.php’;
}
elseif ( in_category(‘arts-entertainment’) || post_is_in_descendant_category( 17 ) || is_page(‘arts-entertainment’)) {
include ‘includes/nav-ent.php’;
}
elseif ( in_category(‘living’) || post_is_in_descendant_category( 19 ) || is_page(‘living’)) {
include ‘includes/nav-liv.php’;
}
elseif ( in_category(‘opinion’) || post_is_in_descendant_category( 18 ) || is_page(‘opinion’)) {
include ‘includes/nav-opn.php’;
}
elseif ( in_category(‘sports’) || post_is_in_descendant_category( 20 ) || is_page(‘sports’)) {
include ‘includes/nav-spt.php’;
}
else {
include ‘includes/nav-home.php’;
}
?>==================
FYI: The idea is to use a different color for navigation for each page in the conditional statement.