the ‘is_page()’ is within a ‘in_category()’ conditional statement, and is therefore never checked (pages do not have categories).
what are you trying to check with your conditional statements?
are you possibly trying to work with ‘elseif’?
http://php.net/manual/en/control-structures.elseif.php
Page 2164 is a Post
this is a contradiction – either page or post
did you try to check for is_single() ?
https://codex.ww.wp.xz.cn/Function_Reference/is_single
Thread Starter
esilk
(@esilk)
@michael – is_single(2164) almost seems to work. Here’s what I’m trying to accomplish:
<?php if (in_category('4')): ?>
<?php elseif (is_single(2164)): ?>
<h1 class="post-title"><?php the_title(); ?></h1>
<?php else: ?>
<h1 class="post-title"><?php the_title(); ?></h1>
<?php endif; ?>
<?php if (!is_single(2164)): ?>
<div id="detailslink"><a id="down1" class="down link" href="#details"><img src="/wp-content/themes/rally/images/details.gif" width="139" height="35" alt="More Details" /></a></div>
<?php endif; ?>
So on post 2164, the detailslink div does NOT show up, and it does appear on all other posts. However, the title does NOT display as it should.
I can force the title this way, but I thought there should be something a little more elegant:
<?php $postid = get_the_ID(); ?>
<?php if ($postid == 2164): ?>
<h1 class="post-title"><?php the_title(); ?></h1>
<?php endif; ?>
<?php if (in_category('4')): ?>
<?php elseif (is_single(2164)): ?>
<h1 class="post-title"><?php the_title(); ?></h1>
<?php else: ?>
<h1 class="post-title"><?php the_title(); ?></h1>
<?php endif; ?>
<?php if ($postid != 2164): ?>
<div id="detailslink"><a id="down1" class="down link" href="#details"><img src="/wp-content/themes/rally/images/details.gif" width="139" height="35" alt="More Details" /></a></div>
<?php endif; ?>