Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to add a custom button


  • akira010203
    Participant

    @akira010203

    Hello,

    In order to implement my board, I want to put a link a the top right of my forum main page which will redirect to [bbp-topics-index] like that :

    I’m thinking using <span onclick=”window.location.href=’www.google.com’;”>text</span>
    but I don’t know where to put it in my child theme.

    Can someone help me please ?

    Thanks!

Viewing 2 replies - 26 through 27 (of 27 total)

  • Robin W
    Moderator

    @robin-w

    I’ll let you work out the correct css – it’ll be trial and error


    akira010203
    Participant

    @akira010203

    Hello, my skills are too limited to do that. I’ve simply moved it carefully to be visible for all.

    Can you please remove all our posts previous posts to clean the topic ?

    TO CONCLUDE :

    function rew () {
    
     if ( is_user_logged_in() ) {
    echo '<p><a href="http://your_url/new-posts"><div class="newposts">Show new posts</div></a></p>' ;
    }
    else
    echo '<p><a href="http://your_url/new-posts"><div class="newposts">Show new posts</div></a></p>' ;
    }

    Put this into function.php of your child theme

    .newposts {  
    	 float: left;
    	 background-color:#DD9933;
             padding: 5px 6px;
    	 margin:5px 5px 2em 0;
    			
    }
    
    .newposts a { 
            color:#f2f2f2 !important;
    	border:none;
    	border-radius:0;
    	box-shadow: none;
    	color:#ffffff;
    	font-size:13px;
    }
    

    And put that into your custom style.css. If your button doesnt appear while your loggued or while you’re not, take care of the margin and the padding of the CSS!

    You will have to create a new page “new-posts”. Add [bbp-topic-index] to this page to display your topics in order (most recent ones). If you need a more customizable list, install BBP-Style Pack and go to the Shortcodes section.

Viewing 2 replies - 26 through 27 (of 27 total)
  • You must be logged in to reply to this topic.
Skip to toolbar