Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 6,701 through 6,725 (of 32,505 total)
  • Author
    Search Results
  • munkitkat
    Participant

    I tried creating a plugin from the code above, but I couldn’t activate it. Can someone please help me with a step by step fix for a regular WP install?

    #173081
    Pascal Casier
    Moderator

    Thanks for the code !
    Pascal.

    #173074
    MarcGuay
    Participant

    Hi Pascal,

    Thanks for replying. It seems that the bbp_form_option() function is not available where I’m trying to get the value, but it’s basically a wrapper for get_option() so I can use that. Also, I was trying to grab the forum root slug, so the following has worked for me:

    home_url(get_option( '_bbp_root_slug', 'forums' ));

    Thanks for pointing me in the right direction.
    Salut,
    Marc

    #173072
    Pascal Casier
    Moderator

    Can’t test here, but did you check echo bbp_form_option( '_bbp_forum_slug', 'forum', true ); ?

    #173068
    MarcGuay
    Participant

    Here’s a filter that will redirect admins and editors to the admin panel after login.

    add_filter('bbp_redirect_login', 'custom_bbp_redirect_login', 10, 3);
    function custom_bbp_redirect_login($url, $raw_url, $user){
    	if ( !empty($user) && !empty($user->roles) && (in_array( 'administrator', (array)$user->roles ) || in_array( 'editor', (array)$user->roles )) ) {
    		return get_admin_url();
    	} 
    	return $url;
    }
    #173063
    Robin W
    Moderator

    @tech55541

    If it works on PC, tablets etc. but doesn’t on a mobile, this will not be code functionality, but either JS or CSS.

    Given that few mods will have the time to work out what this code is doing, let alone load it to their site, a URL to a page where it works on a PC but doesn’t on a mobile would be useful.

    #173058
    karthickeyang
    Participant

    i want to show search bar on top of category page,
    i pasted <?php echo do_shortcode(“[bbp-search-form]“); ?>
    above shortcode in content-single-forum.php , i get search bar in category page but in sub forums page
    i get 2 search bar..

    #173050
    kodacollider
    Participant

    I’m not, I am using a child theme of Twenty Twelve that I’ve been creating.

    I actually got this figured out, on a whim I decided to try your $args[‘type’] = ‘list’; again and for whatever reason this time it worked. I don’t know if I may have just overlooked it the first time, or what.

    My function:

    function bbp_custom_pagination_links( $args ) {
        $args['type'] = 'list';
        return $args;
    }
    add_filter ('bbp_topic_pagination','bbp_custom_pagination_links');

    I will still have to go through and do the same thing for other instances of pagination within bbPress, but that has worked for the topic list. It’s just a matter of styling the list elements with CSS at that point to get them aligned horizontally.

    Thanks for all of your help, I really do appreciate it.

    #173049
    Stephen Edgar
    Keymaster

    Right, clear as mud then 😉 But this does sound like this is the expected behaviour 🙂

    Trivia: bbPress.org theme here shows both @username and “Display Name” because people used to try and ping me via @Stephen Edgar, rather than @netweb, hence we added both to the template loops 🙂

    #173047
    tech55541
    Participant

    Hello,
    I have this code that I used to create a custom BBPress options menu. It works great. The only thing it does not do is close on a mobile device when the options menu is clicked again. Could you please help me add this functionality?

    functions.php code

    /* Custom BBPress admin links menu*/
    function wpmudev_bbp_admin_links_in_menu($retval, $r, $args) {
       if ( is_user_logged_in() ) {
       $menulinks = '<ul id="bbp_custom_links_menu-' . $r["id"] . '" class="bbp_custom_links_menu">';
        $menulinks .= '<li class="parent"><a href="#bbp_custom_links_menu-' . $r["id"] . '">Options</a>';
        $menulinks .= '<ul class="bbp_custom_links_submenu">';
        foreach($r['links'] as $key => $val) {
            $menulinks .= "<li>{$val}</li>";
        }
        $menulinks .= '</ul></li></ul>';
    
        echo $r['before'] . $menulinks . $r['after'];
        }
    }
    add_filter('bbp_get_topic_admin_links', 'wpmudev_bbp_admin_links_in_menu', 10, 3);
    add_filter('bbp_get_reply_admin_links', 'wpmudev_bbp_admin_links_in_menu', 10, 3);
    
    add_action( 'wp_footer', 'overflow_overriding' );
    function overflow_overriding() {
        if ( !is_user_logged_in() ) {
        }else{
        ?>
        <script type="text/javascript">
    		jQuery( document ).ready(function() {
    		   jQuery('.bbp-admin-links:even').css({"position": "absolute", "right": "380px"});
    		});
        </script>
    
         <?php
        }
    }

    Thanks for the help.

    #173042

    In reply to: Recents topics

    Robin W
    Moderator

    load my style pack, and you’ll find a shortcode to do just this

    https://wordpress.org/plugins/bbp-style-pack/

    #173039
    rmuhr1701
    Participant

    ok after some poking and prodding and trying with filter, still no joy, but did find more information.
    When I am not logged in and the role/link works, the class used is bbp-topic-author
    When I am logged in and the link/role does not work the class is bbp-reply-author

    I tried

    
    function ShowRoles($args =array()){
    $args['show_role']  = true;
    return $args;
    }
    
    add_filter('bbp_before_get_reply_author_link_parse_args','ShowRoles');

    but there is no change. It is almost like the css section is being suppressed all together.

    Any insight?

    #173024
    Pascal Casier
    Moderator

    2 tips:
    – Install my bbP Toolkit
    – Use the code below:

    // Change freshness time by removing the last part, so '1 month, 3 days ago' becomes '1 month ago'
    function casiepa_shorten_freshness_time($return) {
    	$return = preg_replace( '/, .*[^ago]/', ' ', $return );
    	return $return;
    }
    add_filter( 'bbp_get_time_since', 'casiepa_shorten_freshness_time' );
    add_filter( 'bp_core_time_since', 'casiepa_shorten_freshness_time');

    PS. Ben je niet op https://wpnl.slack.com ?

    mvaneijgen
    Participant

    In loop-single-topic.php the following function is requested <?php bbp_topic_last_active_time();?> and this will display 2 weeks, 1 day ago I would like to only state the first part so 2 weeks ago and lose the specificity of it being a 1 day

    There are different kinds of specificity depending on when the topics was last active like:
    1 day, 23 hours ago
    2 weeks, 1 day ago
    1 month, 2 weeks ago

    and I would like to convert them all to
    1 day ago
    2 weeks ago
    1 month ago

    Any tips on this would be highly appreciated.

    #172997
    tech55541
    Participant

    Hello,
    OK, was not all the way fixed, but I was able to get it there.

    @media screen and (max-width:480px) {
    .bbp-reply-author {
    float: none !important;
    clear: both;
    margin-left: 0px !important;
    }
    }
    #172996
    tech55541
    Participant

    Hello,
    I guess it was the !important rule tripping me up, I tried restricting it to desktop devices only and that still did not fix it. I worked with WPMU DEV a little more to come up with this which has seemed to fix it. Why I do not know, all I know is that it is fixed now.

    @media screen and (max-width:480px) {
    .bbp-reply-author {
    float: none;
    clear: both;
    }
    }

    Thanks.

    #172995
    Robin W
    Moderator

    The issue is on line 307 of sccss which says

    .bbp-reply-content > p {
      font-size: 14px;
      margin-left: -37px !important;
    }
    

    The margin left is causing it to display incorrectly

    #172987
    volican
    Participant

    Solved by replacing the bit I though wasn’t working with:

    li.bbp-topic-title { width:50%; }
    
    li.bbp-topic-voice-count, li.bbp-topic-voice-count {
    	text-align: center;
    	width: 30%;
    }
    
    li.bbp-topic-reply-count, li.bbp-topic-reply-count {
    	text-align: center;
    	width: 20%;
    }
    
    #172984

    In reply to: Sorting Topic Loop

    chuyqwerty
    Participant

    @casiepa, just wondering if you had a chance to look at my code.

    Thanks

    #172978
    volican
    Participant

    When I use bbpress I notice that on the mobile it is all squished up. To solve this I have removed the freshness column and adjusted the spacing of the info, topic and posts columns. This works on the forums page but when I click on one of the forums the freshness column is removed but the spacing seems to be the same. Can you see what I have done wrong with my css?

    li.bbp-forum-freshness, li.bbp-forum-freshness {
    	display: none;
    }
    
    li.bbp-forum-freshness, li.bbp-topic-freshness {
    	display: none;
    }
    
    li.bbp-forum-info, li.bbp-topic-title { width:50%; }
    
    li.bbp-forum-topic-count, li.bbp-forum-topic-count {
    	text-align: center;
    	width: 30%;
    }
    li.bbp-forum-reply-count, li.bbp-forum-reply-count {
    	text-align: center;
    	width: 20%;
    }
    
    ////// This is the bit that isn't playing nice
    
    li.bbp-forum-info, li.bbp-topic-title { width:50%; }
    
    li.bbp-forum-topic-count, li.bbp-topic-topic-count {
    	text-align: center;
    	width: 30%;
    }
    li.bbp-forum-reply-count, li.bbp-topic-reply-count {
    	text-align: center;
    	width: 20%;
    }

    Many thanks 🙂

    #172949

    In reply to: language change

    Pascal Casier
    Moderator

    Hi,
    bbPress translation files comes automatically and the ‘search’ button is in the translated list:
    value="<?php esc_attr_e( 'Search', 'bbpress' ); ?>"
    But I see you also have ‘topics’, ‘posts’ and ‘freshness’, so nothing is translated.

    Can you please tell me:
    1) in what language locale your WordPress is running in ?
    Dashboard > Settings > General Settings > Site Language

    2) What version of WordPress and bbPress you are using ?

    Pascal.

    duvanmonsa
    Participant

    I had the same error i did this piece of code and the status code will be force to be 200 in my case was when i was showing the user public profile.

    function bbp_fix_users_404_headers() {
      if (bp_displayed_user_id() != 0 && is_404() ) {
        global $wp_query;
        $wp_query->is_404 = false;
        status_header( 200 );
      }
    }
    add_action( 'wp', 'bbp_fix_users_404_headers',0 );
    #172928

    In reply to: Sorting Topic Loop

    chuyqwerty
    Participant

    Ok thanks for the explanation. I guess it was too long so it was not going through.

    Here is my looptopics.php code. I got the filtering to work correctly, except a big problem is that it ignores sticky posts. It does not even grab the sticky css class so I definitely did something wrong.

    http://pastebin.com/u4Ci0kYK

    Thanks for the help

    #172927

    In reply to: Sorting Topic Loop

    Pascal Casier
    Moderator

    If not too long, you can put it between backquotes.
    So click the ‘code’ button (one but last button in the box where you type your reply), paste your code, then click that same button that will now be called ‘/code’

    If it too long, paste it somewhere else like pastebin or github and just put a link.

    #172924

    In reply to: Sorting Topic Loop

    chuyqwerty
    Participant

    Ok, this is a dumb question but how do I paste source code here?…

Viewing 25 results - 6,701 through 6,725 (of 32,505 total)
Skip to toolbar