Mark
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Target posts that only have 1 specific tagAh, that second solution sounds like it might be the one.
How do I display the tags using that one?
Would I replace
<p>This post has exactly two tags, and one of them is tag-one!</p>
with
<?php echo $tags; ?>
Forum: Themes and Templates
In reply to: Target posts that only have 1 specific tagThis sort of does it but only seems to make the first if statement work.
<?php $posttags = get_the_tags(); $count=0; if ($posttags) { foreach($posttags as $tag) { $count++; if (!has_tag('tag-name') && (1 == $count)) { echo $tag->name . ' '; } }} elseif ($posttags) { foreach($posttags as $tag) { $count++; if (has_tag('tag-name') && (1 == $count)) { echo 'Text'; } }} elseif ($posttags) { foreach($posttags as $tag) { $count++; if (has_tag('tag-name') && (2 == $count)) { echo $tag->name . ' '; } }} else { echo 'Text'; } ?>
Forum: Themes and Templates
In reply to: Target posts that only have 1 specific tagMany thanks, I think this could work.
I’ve been thinking about what I’m trying to do. Is it possible to extend this with some elseif magic?
I know the following is incorrect but something like…
<?php $tags = get_the_tags(); if ( has_tag( 'tag-name' ) && 2 == count( $tags ) ) : ?> ... do something ... <?php elseif; ?> $tags = get_the_tags(); if ( has_tag( 'tag-name' ) && 1 == count( $tags ) ) : ?> echo 'Text'; <?php elseif; ?> $tags = get_the_tags(); if ( !has_tag( 'tag-name' ) && 1 == count( $tags ) ) : ?> ... do something ... <?php endif; ?>
I want something that says…
If the post has 2 tags (and one of them is the one specified) then display the 2nd tag.
If the post has 1 tag (and it is the one specified) then display some text.
If the post has 1 tag (and it is NOT the one specified) then display the tag.
Forum: Plugins
In reply to: [Plugin: WP phpBB Bridge] Can't DEACTIVATE plugin without breaking sitePolite nudge. ??
Anyone got any ideas about this?
Forum: Plugins
In reply to: [Plugin: WP phpBB Bridge] Can't DEACTIVATE plugin without breaking siteThis definitely seems like a permalinks issue.
When I deactivate the plugin, posts and category pages return 404’s.
If I set permalinks to be the default /?p=123 setting then they work again.
I try putting it back to the ‘Month and name’ setting and they return 404’s again.
I have to reactive the WP phpBB Bridge plugin for them to work again!
This is driving me insane. Anyone got any idea what I can do? Thanks.
Forum: Fixing WordPress
In reply to: Add prefix to post tiles in a certain categorySweet ??
Thanks very much.
Forum: Fixing WordPress
In reply to: Add prefix to post tiles in a certain categoryThanks esmi ??
Just looking at your code, how does that only specify posts only within the pocdcast category?
Forum: Plugins
In reply to: [WP phpBB Bridge] [Plugin: WP phpBB Bridge] Author AvatarAny chance you can post the solution? Cheers
Forum: Fixing WordPress
In reply to: Control nested/child commentsAh, right. I didn’t need to mention the function again.
Sorted, works a charm. Thanks again.
Forum: Fixing WordPress
In reply to: Control nested/child commentsI’m trying to add some extra text on nested comments, that doesn’t appear on the parent ones.
I’ve tried adding this just before the comment reply button from within my custom comment display.
<?php if custom_comment($depth > 1) { ?> <p>Some text here</p> <?php } ?>
That breaks my page though : (
Forum: Fixing WordPress
In reply to: Control nested/child commentsThanks again for the reply Joseph… and thank you coco001 for the spam.
I’m actually already using a custom comment display using the callback function.
Where do I slot this condition into the function? I assume it would be here somewhere…
if (!function_exists("custom_comment")) { function custom_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment;
Forum: Fixing WordPress
In reply to: PHP help – exclusively allow users to respond to their own commentsAh! I have to declare that before? I’ve been declaring it all over the place haha
<?php global $current_user;get_currentuserinfo(); $current_user->user_email; ?> <?php if ($comment->comment_author_email == $current_user->user_email) echo comment_reply_link(array ('reply_text' => 'Respond', 'depth' => $depth, 'max_depth' => $args['max_depth'])) ?>
That seems to have done the trick.
Thanks Joseph, appreciate the help buddy. : )
Forum: Fixing WordPress
In reply to: PHP help – exclusively allow users to respond to their own commentsYea, I’m just not sure how to slot it into my current code.
I’ve tried…
<?php if ($comment->comment_author_email == $current_user->user_email) echo comment_reply_link(array (‘reply_text’ => ‘Respond’, ‘depth’ => $depth, ‘max_depth’ => $args[‘max_depth’])) ?>
…but that didn’t work.