Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 2,576 through 2,600 (of 32,516 total)
  • Author
    Search Results
  • torimc125
    Participant

    Thank you, Robin, for your reply. I downloaded Code Snippets and I added the above line, you provided, wp-content/themes/%your-theme-name%/functions.php. I changed %your-theme-name% to my theme, but I receive this fatal error.

    Don’t Panic
    The code snippet you are trying to save produced a fatal error on line 1:
    syntax error, unexpected end of file

    Was I supposed to add the below to code snippet?

    add_filter( ‘get_the_archive_title’, ‘to_archive_title_remove_prefix’ );
    function to_archive_title_remove_prefix( $title ) {
    if ( is_post_type_archive() ) {
    $title = post_type_archive_title( ”, false );
    }
    return $title;
    }

    #213006
    Robin W
    Moderator

    bbpress just uses WordPress registration and login.

    bbpress then just assigns the default role on first login that is set in Dashboard>settings>forum>roles if you have that ticked, or you can manually assign if you wish.

    Therefore you can ignore anything bbpressy on registration and login, and just use anything that WordPress does instead.

    This gives you the ability to utilise plugins such as ‘theme my login’ to give yourself a nice registration and login (there are plenty of other good login plugins, just search around).

    It looks like you have already changed the default wp urls – which is great and good security practise, so suggest you just don’t use bbpress login shortcodes or widgets, and let wordpress do your registration and login.

    Do come back if you need further help

    Robin W
    Moderator

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

    where %your-theme-name% is the name of your theme

    or use

    Code Snippets

    #212973
    kriskl
    Participant

    oh Robin, you are a star! 🙂

    the code did wonders.

    I’ll leave the dots as they make sense when going through the pages later.. so it’s consistent.

    and thanks! I was so silly, not realising about editing out the code
    <?php bbp_get_template_part( ‘pagination’, ‘topics’ ); ?>
    in templates

    I thought there was some function code trick :))

    I hope you have a nice weekend, thanks again!

    ps. maybe you should add this filter as an option
    add_filter (‘bbp_before_paginate_links_parse_args’ , ‘rew_pagintion’ ) ;

    in your plugin?

    it seems many users might find it useful

    #212971
    Robin W
    Moderator

    oh, and I found a bit where we can do some string editing, so…

    This code reduces the last to 1 entry, and then looks for that entry and removes it…

    add_filter ('bbp_before_paginate_links_parse_args' , 'rew_pagintion' ) ;
    
    function rew_pagintion ($args) {
    	$args['end_size'] = 0 ;
    return $args;
    }
    
    add_filter ('bbp_make_first_page_canonical', 'rew_take_out_last', 10 ,2) ;
    
    function rew_take_out_last ($retval, $pagination_links) {
    	$posf = strrpos ($pagination_links, '<a class="page-numbers' ) ;
    	$posl = strpos ($pagination_links, '<a class="next page-numbers' ) ;
    	$start = substr ($pagination_links, 0 , $posf) ;
    	$end = substr ($pagination_links, $posl , strlen($pagination_links)) ;
    	$links = $start.$end ;
    return $links ;
    }

    you can get rid of the page number dots using css or some more str functions in the code above, but I’ll leave you to work that out 🙂

    #212970
    Robin W
    Moderator

    yes, find
    wp-content/plugins/bbpress/templates/default/bbpress/content-single-forum.php

    transfer this to your pc and edit

    you’ll see

    <?php bbp_get_template_part( 'pagination', 'topics'    ); ?>
    
    <?php bbp_get_template_part( 'loop',       'topics'    ); ?>
    
    <?php bbp_get_template_part( 'pagination', 'topics'    ); ?>

    change that to take out the first line and save

    create a directory on your theme called ‘bbpress’
    ie wp-content/themes/%your-theme-name%/bbpress

    where %your-theme-name% is the name of your theme

    Then transfer the file you saved above and put in in the directory called bbpress that you created above, so you end up with
    wp-content/themes/%your-theme-name%/bbpress/content-single-forum.php

    bbPress will now use this template instead of the original

    #212964
    kriskl
    Participant

    yes,

    I have disabled all plugins but BBpress. and changed to WordPress default theme.
    with your code
    this is what it looks like:

    1 2 … 2,843 →
    it still shows the last page: 2,843

    https://opendev.leetdns.com/forums/

    #212962
    Robin W
    Moderator

    ok, so did you try MY code on another site?

    #212960
    kriskl
    Participant

    yhm,
    I will try on another test site
    maybe some plugin conflict..
    here is some code above and below

    //ONLY BBPress below
    //create vertical list subforum layout
    function custom_bbp_sub_forum_list() {
      $args['separator'] = '
    ';
      return $args;
    }
     add_filter('bbp_after_list_forums_parse_args', 'custom_bbp_sub_forum_list' );
     
    
    function ra_bbp_increase_pagination($args) {
        $args['end_size'] = 0;
        $args['mid_size'] = 3;
        return $args;
    }
    add_filter( 'bbp_topic_pagination', 'ra_bbp_increase_pagination' );
    
    function rk_hot_topics() {
       $reply_count = bbp_get_topic_reply_count();
      
       if ( $reply_count > 5 )
          echo '<span class="hot">HOT</span>';
    }
      
    add_action( 'bbp_theme_before_topic_title', 'rk_hot_topics' );
    #212958
    Robin W
    Moderator

    if you change
    bottom:15px;

    to

    bottom:1px ;

    it works

    #212957
    Robin W
    Moderator

    yes your theme has a style sheet

    wplms/assets/css/bbpress.min.css

    which contains

    #bbpress-forums ul.bbp-forums li.bbp-body .reply .bbp-reply-header .bbp-admin-links,
    #bbpress-forums ul.bbp-forums li.bbp-body div.hentry .bbp-reply-header .bbp-admin-links,
    #bbpress-forums ul.bbp-replies li.bbp-body .reply .bbp-reply-header .bbp-admin-links,
    #bbpress-forums ul.bbp-replies li.bbp-body div.hentry .bbp-reply-header .bbp-admin-links,
    #bbpress-forums ul.bbp-topics li.bbp-body .reply .bbp-reply-header .bbp-admin-links,
    #bbpress-forums ul.bbp-topics li.bbp-body div.hentry .bbp-reply-header .bbp-admin-links {
     position:absolute;
     bottom:15px;
     right:0
    }

    which moves the links, and makes them unclickable

    #212956
    kriskl
    Participant

    hi,

    yes it is in the correct child theme 🙂

    I have also tried this code – which seems similar to yours, and I can make more page numbers – front and end. but I can’t remove the end with 0

    function ra_bbp_increase_pagination($args) {
        $args['end_size'] = 0;
        $args['mid_size'] = 2;
        return $args;
    }
    add_filter( 'bbp_topic_pagination', 'ra_bbp_increase_pagination' );
    #212954
    Robin W
    Moderator

    so the functions.php file that is in your child theme – yes ? (sorry but the obvious questions so often lead me to a solution!)

    and can you paste the code with say the function above or below it, so I can check that it is not erroring due to syntax.

    #212952
    Robin W
    Moderator

    in your functions file or code snippets ?

    #212951
    kriskl
    Participant

    Thanks for quick reply,

    I have just tried the code and nothing has changed :((

    #212950
    Robin W
    Moderator

    yes I see 🙂

    Put this in your child theme’s function file – or use

    Code Snippets

    add_filter ('bbp_before_paginate_links_parse_args' , 'rew_pagintion' ) ;
    
    function rew_pagintion ($args) {
    	$args['end_size'] = 0 ;
    return $args;
    }
    #212941
    proversion88
    Participant

    I want to separate wordpress and bbpress..wordpress is on my main domain and I want to setup bbpress on a subdomain like forum.mydomain.com

    I tried with adding bbpress, but it really mess up everything on the membership side as it is already setup with custom themes and plugins and lot of modifications through code. I also need to use separate theme for forum as the default is not integrated well with my current theme..For these reasons, I want to install wp and bbpress on a subdomain as separate installation and keep it private and closed for registrations..

    I checked the link you posted, and it was talking about using same database for both wp installations..But in that case, their worpdress installation is identical..Mine has too nuch complicated structure in one and the forum installation will just need bbpress only..

    #212938
    Robin W
    Moderator

    thinking about it, putting this in the custom css part of your theme should work

    .dummy {
    	display: none;
    }
    #212934
    Robin W
    Moderator

    this should get you somewhere, although does throw up some raw displays in the backend

    add_filter( 'bbp_get_forum_content', 'rew_show_paras' , 10 , 2 );
    
    function rew_show_paras ($content, $forum_id) {
    	$post = get_post($forum_id);
    	$the_content = apply_filters('the_content', $post->post_content);
    return $the_content ;
    }	
    #212931
    theicebooky
    Participant

    Is it possible to allow spacing in the BBpress Forum description? Right now, even when you created different paragraphs for the description, the spacing will disappear and the paragraph will be squished together in the shown forum description.

    Is there a way to get different paragraphs to seperated when thr forum description is shown?

    Is there a code snippet that I can add? I don’t know how to code but I would love this to work.

    If you want picture examples, I will be more than happy to provide!

    #212927
    Robin W
    Moderator

    it is theme related

    and yes you have a theme item of

    <div class="dummy" style="padding-top: 100%;"></div>

    and this sits below the header and creates this space.

    which method in item 3 of this link are you using ?

    Step by step guide to setting up a bbPress forum – Part 1

    #212925
    forehanded5
    Participant

    I just installed bbPress through the plugin panel and added some test forums. It seems like there is a very large empty DIV that I don’t know how to get rid of causing a large space between the forum header and the forums. Any ideas on how to get rid of it?

    It’s only showing up on the main forums home page and not any other pages when you navigate into the forums or posts.

    Currently using the Uncode theme. WP, plugins, themes, etc are all up to date.

    Forums are at: http://foxtrotbattleline.com/forums

    #212924

    In reply to: Taxonomies for Topics

    Robin W
    Moderator

    This article explains it quite well and the save hooks

    add_action ( 'bbp_new_topic', 'bbp_save_extra_fields', 10, 1 );
    add_action ( 'bbp_edit_topic', 'bbp_save_extra_fields', 10, 1 );

    are still there

    https://wp-dreams.com/articles/2013/06/adding-custom-fields-bbpress-topic-form/

    kriskl
    Participant

    Hi,

    I would like to remove the last page numbers in pagination,
    is there any function code to do this?

    at the moment, on latest topics on a big forum.. it shows like this..

    1 2 3… 8432 8442 8445 →

    Thanks
    kris

    #212903
    Robin W
    Moderator

    the answer is no, the plugin does what it does.

    what do you want a shortcode to do and where would you want to place it?

Viewing 25 results - 2,576 through 2,600 (of 32,516 total)
Skip to toolbar