dam typo’s –
great β glad youβre continuing to get there π
heres is what i have now , the sticky and super sticky link are still in one li
because i dont know how to split the two links
there is a new problem though with a new css way of displaying a dropdown and working on every post , i have run into some blank lists when i switch to a user with a participant role.
i thought maybe i could use
if current_user_can 'moderate'
to display only the certain lists (<li>
)
and also only show the entire menu if the user is logged in
but i dont know how to stack three if functions together
this is the code i have in my loop-single-reply.php
<?php if (bbp_is_topic(bbp_get_reply_id()) ) { ?>
<div id="bbpdropdown">
<div class="wrapper">
<div class="content">
<ul>
<li> <?php echo bbp_get_user_favorites_link(); ?></li>
<li> <?php echo bbp_get_user_subscribe_link(); ?></li>
<li> <?php echo bbp_get_topic_edit_link(); ?></li>
<li><?php echo bbp_get_topic_close_link(); ?></li>
<li><?php echo bbp_get_topic_stick_link(); ?></li>
<li><?php echo bbp_get_topic_merge_link(); ?></li>
<li><?php echo bbp_get_topic_trash_link(); ?></li>
<li><?php echo bbp_get_topic_spam_link(); ?></li>
</ul>
</div>
<div class="first">Options</div>
</div>
<?php } ?>
<?php if (bbp_is_reply(bbp_get_reply_id()) ) { ?>
<div id="bbpdropdown">
<div class="wrapper">
<div class="content">
<ul>
<li><?php echo bbp_get_reply_edit_link(); ?></li>
<li><?php echo bbp_get_reply_move_link(); ?></li>
<li><?php echo bbp_get_topic_split_link(); ?></li>
<li><?php echo bbp_get_reply_trash_link(); ?></li>
<li><?php echo bbp_get_reply_spam_link(); ?></li>
</ul>
</div>
<div class="first">Options</div>
</div>
<?php } ?>
This is what i have in my custom css
#bbpdropdown {
margin:0;
font-family:inherit;
}
#bbpdropdown .wrapper {
display: inline-block;
width: 80px;
margin-right: 10px;
height: 0px;
position: relative;
float: right;
bottom:5px;
}
#bbpdropdown .first {
width: 100%;
display: inline-block;
cursor: pointer;
line-height: 30px;
height: 30px;
background: #fff;
color: #222;
font-weight: bold;
z-index: 2;
position: relative;
text-align: center;
border:1px solid #ddd;
}
#bbpdropdown .first:hover,
#bbpdropdown .content:hover ~ .parent {
background: #fff;
-webkit-transition-delay: 0s, 0s, 0s;
}
#bbpdropdown .content:hover ~ .parent {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
z-index: 0;
}
#bbpdropdown .content {
position: absolute;
display: block;
z-index: 1;
height: 0;
width: 80px;
box-shadow: none);
padding-top: 30px;
border: none;
}
#bbpdropdown .wrapper:active .content {
height: auto;
z-index: 3;
-webkit-transition-delay: 0s;
}
#bbpdropdown .content:hover {
height: auto;
z-index: 3;
-webkit-transition-delay: 0s;
}
#bbpdropdown .content ul {
background: #fff;
margin: 0;
padding: 0;
overflow: hidden;
height: 100%;
}
#bbpdropdown .content ul a {
text-decoration: none;
color:#222;
font-size:11px;
}
#bbpdropdown .content li:hover {
background: #999;
color: #222;
}
#bbpdropdown .content li {
list-style: none outside none;
text-align: center;
color: #222 !important;
font-size: 14px;
height: 30px;
line-height:30px;
border-top: 1px solid #DDD;
}
@robin-w you want to try this??
yes I’ll give it a go, but may not be for a couple of days – relatives staying !!
ok, stacking can be fun, and I’m sure we can get it to work. lets start with the topics list
bbp_get_user_favorites_link();
bbp_get_user_subscribe_link();
bbp_get_topic_edit_link();
bbp_get_topic_close_link();
bbp_get_topic_stick_link();
bbp_get_topic_merge_link();
<bbp_get_topic_trash_link();
bbp_get_topic_spam_link();
can you tell me when you would like them to display
eg
bbp_get_user_favorites_link(); when user is logged in and if they are participant
bbp_get_user_subscribe_link(); when user is logged in and if they are moderator or keymaster
bbp_get_topic_stick_link(); anyone whether logged in or not
etc
turns out there is this theme that has this function working
check out https://wordpress.org/themes/wp-knowledge-base
put it on a test site and see that i has what i need in that theme
now all i need is to scrape that code out and i think wrap it in an if user is logged in
function and thats it
after that this topic should be done.
@robkk – yes just saw the other thread. Let us know what the resultant code looks like π