Search Results for 'code'
-
AuthorSearch Results
-
July 20, 2020 at 9:25 am #213027
In reply to: Title “Archives: Forum” – change to read “Forums”?
torimc125
ParticipantThank 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 fileWas 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;
}July 19, 2020 at 1:03 pm #213006In reply to: New to bbPress – registration email
Robin W
Moderatorbbpress 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
July 19, 2020 at 9:49 am #212997In reply to: Title “Archives: Forum” – change to read “Forums”?
Robin W
ModeratorPut 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
July 18, 2020 at 11:44 am #212973In reply to: Pagination – How to remove last page numbers?
kriskl
Participantoh 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 templatesI 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
July 18, 2020 at 11:08 am #212971In reply to: Pagination – How to remove last page numbers?
Robin W
Moderatoroh, 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 🙂
July 18, 2020 at 10:50 am #212970In reply to: Pagination – How to remove last page numbers?
Robin W
Moderatoryes, find
wp-content/plugins/bbpress/templates/default/bbpress/content-single-forum.phptransfer 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%/bbpresswhere %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.phpbbPress will now use this template instead of the original
July 18, 2020 at 8:37 am #212964In reply to: Pagination – How to remove last page numbers?
kriskl
Participantyes,
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,843July 18, 2020 at 8:19 am #212962In reply to: Pagination – How to remove last page numbers?
Robin W
Moderatorok, so did you try MY code on another site?
July 18, 2020 at 8:00 am #212960In reply to: Pagination – How to remove last page numbers?
kriskl
Participantyhm,
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' );July 18, 2020 at 7:52 am #212958In reply to: cannot edit, delete or close a topic
Robin W
Moderatorif you change
bottom:15px;to
bottom:1px ;it works
July 18, 2020 at 7:50 am #212957In reply to: cannot edit, delete or close a topic
Robin W
Moderatoryes 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
July 18, 2020 at 7:46 am #212956In reply to: Pagination – How to remove last page numbers?
kriskl
Participanthi,
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' );July 18, 2020 at 6:49 am #212954In reply to: Pagination – How to remove last page numbers?
Robin W
Moderatorso 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.
July 18, 2020 at 6:14 am #212952In reply to: Pagination – How to remove last page numbers?
Robin W
Moderatorin your functions file or code snippets ?
July 18, 2020 at 6:00 am #212951In reply to: Pagination – How to remove last page numbers?
kriskl
ParticipantThanks for quick reply,
I have just tried the code and nothing has changed :((
July 18, 2020 at 5:39 am #212950In reply to: Pagination – How to remove last page numbers?
Robin W
Moderatoryes I see 🙂
Put this in your child theme’s function file – or use
add_filter ('bbp_before_paginate_links_parse_args' , 'rew_pagintion' ) ; function rew_pagintion ($args) { $args['end_size'] = 0 ; return $args; }July 18, 2020 at 2:55 am #212941In reply to: Bridge wordpress users and bbpress
proversion88
ParticipantI 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..
July 18, 2020 at 2:52 am #212938In reply to: Large space between header and forums
Robin W
Moderatorthinking about it, putting this in the custom css part of your theme should work
.dummy { display: none; }July 18, 2020 at 2:32 am #212934In reply to: Allowing Line Spacing in Forum Description
Robin W
Moderatorthis 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 ; }July 17, 2020 at 11:54 pm #212931In reply to: Allowing Line Spacing in Forum Description
theicebooky
ParticipantIs 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!
July 17, 2020 at 1:05 pm #212927In reply to: Large space between header and forums
Robin W
Moderatorit 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 ?
July 17, 2020 at 12:11 pm #212925Topic: Large space between header and forums
in forum Troubleshootingforehanded5
ParticipantI 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
July 17, 2020 at 11:55 am #212924In reply to: Taxonomies for Topics
Robin W
ModeratorThis 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/
July 17, 2020 at 6:00 am #212911Topic: Pagination – How to remove last page numbers?
in forum Troubleshootingkriskl
ParticipantHi,
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
krisJuly 16, 2020 at 1:00 pm #212903In reply to: How can I add badges to users
Robin W
Moderatorthe 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?
-
AuthorSearch Results