XF 2.3 Hide 'Post Thread' Button For Guests

RoyalRumble

Well-known member
We utilise this feature: https://xenforo.com/community/threads/writing-before-registering.181331/

We'd like to keep it, as we like the reply box within threads.

However, due to an advert placement shown only to guests - we'd like to hide the 'Post Thread' button to guests, on the thread title page.

I'm not the best with CSS, but I've tried a few variations like the below but had no luck.

Would anyone be kind enough to advise how I can hide this post thread button to guests?

Code:
/* hide new thread button to guests */

<xf:if is="$xf.visitor.isMemberOf(1)">
    <style>
        .p-title-pageAction {
            display: none;
        }
    </style>
</xf:if>
 
Last edited:
Solution
I would try removing

OR $forum.canCreateThreadPreReg()

From

Code:
<xf:pageaction if="$forum.canCreateThread() OR $forum.canCreateThreadPreReg()">

In forum_view template (line 18)
I would try removing

OR $forum.canCreateThreadPreReg()

From

Code:
<xf:pageaction if="$forum.canCreateThread() OR $forum.canCreateThreadPreReg()">

In forum_view template (line 18)
 
Last edited:
Solution
For future reference, you can use this in the extra.less template to apply styling for guests only.

Less:
[data-logged-in="false"]
{
    .p-title-pageAction
    {
        display: none;
    }
}
 
Back
Top Bottom