klo-wp
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: How to customize the Tag linkI am referring to post tag, and will the same extension for all tags, if a certain condition is met. The condition is that the post should has a tag. With condition i think i can sort out.
Actually I use a specific function to hide a specific tag.
Here is the code I use in function.php
function pk_the_tags( $before = '', $sep = ', ', $after = '', $exclude = '' ) { $tags = get_the_tags(); if ( empty( $tags ) ) return false; $tag_list = $before; foreach ( $tags as $tag ) { if (!empty($exclude)) $pos = stripos( $exclude, $tag->name); else $pos = false; if ($pos=== false) $tag_links[] = '<a href="' . get_tag_link($tag->term_id) . '">' . $tag->name . '</a>'; } if (empty($tag_links)) return false; $tag_links = join( $sep, $tag_links ); $tag_links = apply_filters( 'the_tags', $tag_links ); $tag_list .= $tag_links; $tag_list .= $after; echo $tag_list; }
and in single.php
<?php if (get_the_tags()) pk_the_tags('<span>', '</span><span>', '</span>', 'my_tag_name'); ?>
So the
my_tag_name
will not be showed in the post with the code above.Thanks.
Forum: Fixing WordPress
In reply to: is_tag() versus has_tag()thank for the reply. now i see how it works ?? i was struggling with has_tag() a lot
Thanks. Anyway, you have a great plugin.
Thanks for reply.
Yes I mean “Edit your subscription” link.
Forum: Fixing WordPress
In reply to: Show custom HTML code on sidebar based on author postsany tip?
Forum: Fixing WordPress
In reply to: Show custom HTML code on sidebar based on author postsseems i did not posted any direct question in post before. I am looking for a condition based on user id or better username.
can someone help me?
Forum: Plugins
In reply to: [Lockdown WP Admin] Redirect when user logged insame question for me too
“when user is logged in and try to acess domain.com/login it automatically redirects him to domain.com/wp-admin.Forum: Fixing WordPress
In reply to: Why won't this echo in PHPThanks Josh, this worked ??
Forum: Fixing WordPress
In reply to: Why won't this echo in PHPbroadleon,
doesn’t work this too.
anyway, thanks.
Forum: Fixing WordPress
In reply to: Why won't this echo in PHPJosh,
Doesn’t work. I get the title outside the link, i need it inside.
<a href="https://example.com/<?php the_title(); ?></a>
should be:
https://example.com/TEST
thanks
Forum: Fixing WordPress
In reply to: Why won't this echo in PHPbroadleon
Put code in between
back ticks
. Check Allowed markup, so i can view all your code.thanks
Forum: Fixing WordPress
In reply to: How to show code only selective categoryone more question
echo '<a href="https://...../<?php the_title(); ?>/"></a>';
this seems not work, “<?php the_title(); ?>” how to get title to work?
thanks
Forum: Fixing WordPress
In reply to: How to show code only selective categoryYes thats worked ??
thanks alchymyth, this my second thread solved from you.
wish u the best.
Forum: Fixing WordPress
In reply to: How to show code only selective categorythanks for taking time to help me, i appreciate.
when i add this code
<?php if ( in_category( 'wordpress-theme' )) { // They have long trunks... } ?>
i don’t get any error, but dont see the text “// They have long trunks…” on post page
Forum: Fixing WordPress
In reply to: How to show code only selective categorygot this error
Parse error: syntax error, unexpected ‘<‘
Parse error: syntax error, unexpected ‘}’I’m adding the code to single.php