Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 8,526 through 8,550 (of 32,522 total)
  • Author
    Search Results
  • #163320
    subz
    Participant

    What is the shortcode for listing all topics belonging to two or more forums (multiple forum ids)??

    #163318
    lisigef
    Participant

    I copied the code in https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/#16-adding-description-to-forum-pages but there seems to be a problem with it and I’m just getting a blank page when I try to view the forum (When I comment out the code, the page shows up again, but of course without the description).

    I added the code to functions.php – is it supposed to go somewhere else? IS there some update needed to this code, given that it is a year later?

    Thanks in advance!

    #163310
    nap14hockey
    Participant

    When I use the bbpress index shortcode, it shows only the first 3.5 forums (notice I said 3.5 because the 4th one only the title is shown. I have 7 forums, and I need them to display on the forums page?

    Thanks
    Nap14hockey

    #163299
    project_subdomain
    Participant

    thanks, sam. tried several codes, nothing worked unfortunately (blank page):(

    add_action( 'loop_start', 'divs_only_when_logged_in' );
    
    function divs_only_when_logged_in() {
    
    <?php if ( is_user_logged_in() ) {?>
     
        <div class="new-reply-link">
    
    	<a href="<?php bbp_topic_permalink(); ?>#new-post
    "class="reply-link-text">Reply</a> 
        </div></br>
    
    <ul id="bbp-topic-<?php bbp_topic_id(); ?>-lead" class="bbp-lead-topic">
    
    	<li class="bbp-header">
    
    		<div class="bbp-topic-author"><?php  _e( 'Author',  'bbpress' ); ?>
    </div>
    
    <?php endif; ?>
    }  
    ?>
    #163291
    Sam Rohn
    Participant

    try the wp “is_user_logged_in” function

    https://codex.wordpress.org/Function_Reference/is_user_logged_in

    <?php
    if ( is_user_logged_in() ) {
    	echo 'Welcome, registered user!';
    } else {
    	echo 'Welcome, visitor!';
    }
    ?>

    or

    <?php if ( is_user_logged_in() ) { ?>
    <p>Welcome logged in user<p>
    <?php endif; ?>

    sam

    #163290
    project_subdomain
    Participant

    Hi,
    is there anyone who can help me to get this part

    <div class="new-reply-link">
    
    	<a href="<?php bbp_topic_permalink(); ?>#new-post
    "class="reply-link-text">Reply</a> 
    </div></br>
    
    <ul id="bbp-topic-<?php bbp_topic_id(); ?>-lead" class="bbp-lead-topic">
    
    	<li class="bbp-header">
    
    		<div class="bbp-topic-author"><?php  _e( 'Author',  'bbpress' ); ?>
    </div>
    
    <!-- .bbp-topic-author -->
    

    into an if-statement for logged in users?

    I suppose that
    <?php if ( bbp_is_user_logged_in() ) { ... } ?>
    does not work that simple due to the additional php within, right?
    (no success so far..)

    #163284
    Robkk
    Moderator

    This custom function should remove the “forums” in the breadcrumbs.

    Put it in your child theme functions.php or a functionality plugin to place custom code snippets.

    function rkk_custom_bbpbreadcrumbs() {
        // Remove Forum root from bbPress breadcrumbs
        $args['include_root']    = false;
        return $args;
    }
    
    add_filter('bbp_before_get_breadcrumb_parse_args', 'rkk_custom_bbpbreadcrumbs');
    #163283

    In reply to: Lestify

    Robkk
    Moderator

    your theme thinks bbPress is a blog post.

    usually modifying the main bbPress template will help fix this.

    https://codex.bbpress.org/theme-compatibility/getting-started-in-modifying-the-main-bbpress-template/

    #163274
    Robin W
    Moderator
    #163269
    Robkk
    Moderator

    I meant remove the <pre>

    #163267
    Sktella
    Participant

    Sorry, I just retyped my problem. I forgot to encode the error code.

    Hi,
    I expect to add a Login/Logout to the menu,however,I encountered this syntax error (indicating in the title) while editing the theme functions.php. According to the error message,
    $loginlink = '</pre><ul><li><a title='Logout' href="'.$url2.'">Logout</a></li></ul><pre>';
    is the code causing this parse error.
    Since this code is provided in the documentation and works fine for others, I wonder what the problem is.
    Hope you can help. Thank you so much!

    #163266
    Sktella
    Participant

    Hi,

    I expect to add a Login/Logout to the menu,however,I encountered this syntax error (indicating in the title) while editing the theme functions.php. According to the error message,

    $loginlink = ‘

    ';
    
    is the code causing this parse error. 
    
    Since this code is provided in the documentation and works fine for others, I wonder what the problem is.
    
    Hope you can help. Thank you so much!
    
    #163257

    In reply to: Change colour

    Robkk
    Moderator

    you still have an issue??

    usually people forget the <?php at the start of the functions.php file in their child theme?? if that is it.

    You can also just create a new one then see what code is screwing up your site.

    #163252
    Robkk
    Moderator

    Just shy away from using shortcodes for forum pages , it will be time consuming. You would have to possibly create pages for all instances of any bbPress page. This includes topic pages and user profile pages.

    The way you could get a non-fullwidth layout is to contact your theme author , which I think is Avada for help. Since they have more knowledge of how the theme works and I can’t just buy a theme and test it out and tell you what to do to have this layout.

    You could also do this manually with my help guiding you, but you would need some basic knowledge of how WordPress templates work.

    This guide will help with getting the layout , you would need to add the sidebar code back in like how the example template has. Please note that that is just an example template and is not something to copy and paste since all themes are different.

    https://codex.bbpress.org/theme-compatibility/getting-started-in-modifying-the-main-bbpress-template/

    #163251
    Robkk
    Moderator

    I interprete your “use WordPress as CMS not as blog” as : use “show static page” instead of “show last posts” in “customization”…

    CMS is an acronym content management system, and what I mean is instead of using WordPress for creating blog posts you can just use to manage your forums, users, etc.

    So I should put the bbPress root template as this static page. and fix the root folder as “” ?
    that what you suggest ?

    You could use the forum index shortcode [bbp-forum-index] or [bbp-topic-index] and place this in a page and make that your front page if that is what you want.

    Or create a custom homepage template to use like this site has.

    Read this for information about that. Creating Page Templates

    bbPress

    I don’t want to have a “/forum” in the URL.

    As for removing that I dont think you can , you can remove /forums though in settings > forums.

    You can rename /forum to whatever you want though.

    #163238
    coffeywebdev
    Participant

    Hello Everyone!

    I have my forums installed and I am happy with it. Now I would like to add a checkbox to the edit profile screen..

    I know in form-user-edit.php I can find the code that displays the fields, but can someone give me some insight into how this information is processed once the form is submitted?

    I know that this hidden field holds the action name:
    <input type=”hidden” name=”action” id=”bbp_post_action” value=”bbp-update-user” />

    but after looking at the file bbpress\includes\users\functions.php, where that action is being defined I don’t see where I could add in the extra code to process the custom field if I were to add it.

    I hope I am being clear, all I want to do is add ONE checkbox to every users edit profile page(where they change password/email), and save to user_meta… I know how I can add the field to the front end, but am unsure of how the data gets processed…

    Thanks,
    Anthony

    #163225
    Robkk
    Moderator

    I think you would have to use Multi-site , there are parts of the multisite installation to include either sub-directories or sub-domains.

    And you do not have to use WordPress for a blog , you can just use it instead as a CMS.

    https://codex.wordpress.org/Create_A_Network

    #163213
    Robkk
    Moderator
    #163211

    In reply to: Mobile theme conflict

    Robkk
    Moderator

    Go through some troubleshooting steps.

    It might be a conflicting plugin so leave bbPress and Jetpack activated.

    Troubleshooting

    #163210
    Robkk
    Moderator

    @kenneston

    do you have a custom bbPress theme??
    because the forum description should show on the frontend

    the topic description does not show below the topic title like the forum description should do by default.

    All titles should show though.

    for the forum description make sure you have

    <div class="bbp-forum-content"><?php bbp_forum_content(); ?></div>

    in loop-single-forum.php

    #163209

    In reply to: Sidebar Issue

    Robkk
    Moderator

    Try some troubleshooting steps listed here.

    If they say the issue persists in a default theme , then it either is a plugin issue or just how you are trying to set up your forums.

    Troubleshooting

    #163205

    In reply to: Sidebar Issue

    Robkk
    Moderator

    This is caused because bbPress is rendering a certain template in your theme , this happens to be a template that is full width without a sidebar.

    Is your theme a premium theme or a free theme??

    If it is free, I can check it out and tell you what you need to do.

    If it is premium , the theme authors will have to help you as I cannot just buy a theme just to test it.

    see if this guide can help you though?? It tells you about modifying the main template , you can use this to put the sidebar back in.

    If you have any questions about it or suggested improvements please let me know.

    https://codex.bbpress.org/theme-compatibility/getting-started-in-modifying-the-main-bbpress-template/

    #163202
    Robkk
    Moderator

    the forums shouldn’t show up in pages > all pages

    I am guessing you have put shortcodes in pages to do this.

    I guess if you want to keep putting shortcodes in pages , which will be time consuming , you can use the [bbp-forum-index] shortcode

    #163191
    nikhilnaik
    Participant

    I was thinking in lines of:

    $reply_count = bbp_get_user_reply_count_raw( $user_id);
    if($reply_count==0)
    echo "<span class='mycustom_new_label'>";
    echo "New";
    echo '</span>';

    Any help would be appreciated regarding how to go about doing it.

    nikhilnaik
    Participant

    Hello!

    I successfully implemented the code put up here – New Topics so as to show a new tag next to a topic in forum. But as per this link, the new tag will flash until 3 days. I would want to modify it such that the tag disappears once a user replies to the topic. Is there any function to get this functionality?

    Thanks!

Viewing 25 results - 8,526 through 8,550 (of 32,522 total)
Skip to toolbar