Search Results for 'code'
-
AuthorSearch Results
-
February 16, 2017 at 9:28 am #181772
In reply to: bbPress breadcrumb forum root link issue
dropshot
ParticipantThe problem is if you create a page with the same slug as your forum index and insert the forum index shortcode, this page will just be a page that happens to contain bbpress content. It isn’t a real bbpress page.
If you would like your index page (mysite.com) as your forum index how can you make that a real forum page? NOT just a page that contains bbpress content.
You can’t set your forum root index to nothing cause this will make default value (forums) to reappear. Of course you can 301 redirect /forums to index page. But as mentioned, this will display a page with forum content. NOT a real forum page.
Appreciate any kind of suggestions.
February 16, 2017 at 7:20 am #181766In reply to: Is there an API for bbPress
jpvanmuijen
ParticipantHi, this topic has been very helpful in getting the latest replies, thanks Barry & Robin!
I’m trying to get the topic of the last five replies and later on construct the URL using the topic URL and reply # (kinda like Robin’s shortcode plugin does), but I can’t figure out how to do this.
I changed $author_id = get_post( $single_item[‘id’] )->post_author to $topic_id = get_post( $single_item[‘id’] )->topic hoping it would return the topic ID, but no luck. Is there a way to retrieve how to target this field?
Thanks again!February 16, 2017 at 4:21 am #181755phil49
ParticipantHello Robin,
Thanks for the reply again.
I pasted the code in the additional Custom CSS section in WordPress, indeed I immediately noticed that page width was wider by about 1/5.
However, the “bbpress.php” template was… not affected ! 🙁
I tried copying the code in the style.css in the child theme previously created, but same thing no wide page again !
As I noticed since the beginning, ALL the site pages, I mean the one managed by this epoymous section in WordPress ARE affected by any additional CSS code, BUT NO page in the forum section with the “bbpress.page” Template are concerned by any modification !
It’s as if so long as there’s no modification on the bbpress.php code or it’s CSS, nothing could happen !
Yet, as mentioned earlier, in the child theme I’ve created, I added as explained in this forum : http://www.designbombs.com/master-twenty-seventeen-wordpress-theme/ , the following files :
1 style.css file
1 page-full-width.php
1 function.phpWas there any other operation I should have done ?
For instance, should I try something with the Bbpress-style-pack I’ve installed a few weeks ago for another purpose but that includes a CSS section ?
I don’t really understand what I’m supposed to do, the explanation is not quite clear to me !
It’s explained that it will create a “bspstyle.css” file but what will be the impact on the whole site as I just want to alter page width ONLY on the forum pages, the other pages have the adequate width !
Kind regards,
Philippe
February 15, 2017 at 6:38 pm #181748Robin W
Moderatorok, put this in the custom css
.single-post:not(.has-sidebar) #primary, .page.page-one-column:not(.twentyseventeen-front-page) #primary, .archive.page-one-column:not(.has-sidebar) .page-header, .archive.page-one-column:not(.has-sidebar) #primary { max-width: 100% !important; }you may need to play with it if it affects other parts of your site.
if you don’t know how to do this – come back
February 15, 2017 at 2:21 am #181703In reply to: Last activity link name wrong
Fuskeduske
ParticipantHi RotiSoft,
You can change bbp_get_forum_last_reply_title to bbp_get_forum_last_topic_title, to get rid of the reply-to tag. However this will still make problems, while for example deleting or trashing a topic.
Robin gave me the following code, it should show the latest title without “reply-to” tag: http://pastebin.com/raw/jY5hSPPp
This should be used together with:
<?php do_action( 'bbp_theme_before_forum_freshness_link' ); ?> <?php bbp_forum_freshness_link(); ?> <?php do_action( 'bbp_theme_after_forum_freshness_link' ); ?>However you might need to adjust a little due to the way of your theme setup.
-Fuske
February 14, 2017 at 8:21 pm #181699In reply to: Last activity link name wrong
Tamas Rottenbacher
ParticipantHi @fuskeren!
I don’t use bbPress style pack plugin.
The theme use that code for call the last active topic display:
<a rel="internal" href="<?php bbp_forum_last_reply_url(); ?>" title="Legutóbbi aktív téma: <?php bbp_forum_last_topic_title(); ?>"><?php bbp_forum_last_topic_title(); ?></a>
and under that: (the second line, the time and user)<?php do_action( 'bbp_theme_before_forum_freshness_link' ); ?> <?php bbp_forum_freshness_link(); ?> <?php do_action( 'bbp_theme_after_forum_freshness_link' ); ?>I’m tried add that code:
<?php $forum_id = bbp_get_forum_id( $forum_id ); $active_id = bbp_get_forum_last_active_id( $forum_id ); ?> <?php echo bbp_get_forum_last_reply_url( $forum_id ); ?><br /> <?php echo bbp_get_forum_last_reply_title( $forum_id ); ?>But that add “Comment:” or “Reply:” because that is the reply title, not the last active topic.
February 14, 2017 at 10:11 am #181668In reply to: disable email Email (required) config ?
Fuskeduske
ParticipantHi Crew,
I have just tried running the code on my own test invironment, and i can see, that the code, does not seems to work.
I do however not have enough knowhow to help you further.
I am glad to see, that you got your functions file to work atleast.
February 14, 2017 at 9:48 am #181658In reply to: disable email Email (required) config ?
Fuskeduske
ParticipantHi Crewockeez,
1. Line of Robins code appears to be broken, can you try replacing it with:
add_filter ('bbp_filter_anonymous_post_data' , 'rew_filter_anonymous_post_data' 10, 2);February 14, 2017 at 8:54 am #181648In reply to: Last activity link name wrong
Fuskeduske
ParticipantHi RotiSoft,
Could you provide me with a description of how you’re displaying the titles?
I’ve just recently had a longer correspondence with RobW, about what i think is the same issue.
He told me as follows:
Basically a category holds the last active ID of its sub forums, and each sub forum also holds its last active ID. But deleting a sub forum topic seems to get the category last active ID wrong.
I see that he just updated he’s bbpress style pack plugin, with a hotfix for this issue,
while he gave me the snippet of the code used for the fix, it does not work if your tweak is done if you’re using code as in this: https://bbpress.org/forums/topic/freshness-link/I don’t think Robin would mind me sharing the code snippet, as he implemented it in he’s free plugin, but as requested i would like to know how you’re displaying it.
-Fuske
February 14, 2017 at 8:51 am #181647In reply to: Can I add a forum under a page or post?
Robin W
Moderatorlots of shortcodes available for putting into pages and posts
and I have additional shortcodes in my style pack plugin
February 14, 2017 at 8:12 am #181637In reply to: disable email Email (required) config ?
crewockeez
Participanti try insert new code. not work.
February 14, 2017 at 7:17 am #181623In reply to: disable email Email (required) config ?
Robin W
Moderatorthis – it has some parts changed !!
add_filter ('bbp_filter_anonymous_post_data' , 'rew__filter_anonymous_post_data' 10, 2) ; function rew_filter_anonymous_post_data( $retval, $r ) { // Filter variables and add errors if necessary $r['bbp_anonymous_name'] = apply_filters( 'bbp_pre_anonymous_post_author_name', $r['bbp_anonymous_name'] ); if ( empty( $r['bbp_anonymous_name'] ) ) bbp_add_error( 'bbp_anonymous_name', __( '<strong>ERROR</strong>: Invalid author name submitted!', 'bbpress' ) ); // Website is optional $r['bbp_anonymous_website'] = apply_filters( 'bbp_pre_anonymous_post_author_website', $r['bbp_anonymous_website'] ); // Return false if we have any errors $retval = bbp_has_errors() ? false : $r; // Finally, return sanitized data or false return apply_filters( 'rew_filter_anonymous_post_data', $retval, $r ); }February 14, 2017 at 5:13 am #181613In reply to: disable email Email (required) config ?
crewockeez
Participanti insert code on functions.php on my team
add_filter ('bbp_filter_anonymous_post_data' , 'rew__filter_anonymous_post_data' 10, 2) ; function rew_filter_anonymous_post_data( $retval, $r ) { // Filter variables and add errors if necessary $r['bbp_anonymous_name'] = apply_filters( 'bbp_pre_anonymous_post_author_name', $r['bbp_anonymous_name'] ); if ( empty( $r['bbp_anonymous_name'] ) ) bbp_add_error( 'bbp_anonymous_name', __( '<strong>ERROR</strong>: Invalid author name submitted!', 'bbpress' ) ); // Website is optional $r['bbp_anonymous_website'] = apply_filters( 'bbp_pre_anonymous_post_author_website', $r['bbp_anonymous_website'] ); // Return false if we have any errors $retval = bbp_has_errors() ? false : $r; // Finally, return sanitized data or false return apply_filters( 'bbp_filter_anonymous_post_data', $retval, $r );upload file functions.php on server. open site error.
February 14, 2017 at 5:01 am #181612In reply to: disable email Email (required) config ?
Robin W
Moderatornot sure what you mean, but corrected code here
add_filter ('bbp_filter_anonymous_post_data' , 'rew__filter_anonymous_post_data' 10, 2) ; function rew_filter_anonymous_post_data( $retval, $r ) { // Filter variables and add errors if necessary $r['bbp_anonymous_name'] = apply_filters( 'bbp_pre_anonymous_post_author_name', $r['bbp_anonymous_name'] ); if ( empty( $r['bbp_anonymous_name'] ) ) bbp_add_error( 'bbp_anonymous_name', __( '<strong>ERROR</strong>: Invalid author name submitted!', 'bbpress' ) ); // Website is optional $r['bbp_anonymous_website'] = apply_filters( 'bbp_pre_anonymous_post_author_website', $r['bbp_anonymous_website'] ); // Return false if we have any errors $retval = bbp_has_errors() ? false : $r; // Finally, return sanitized data or false return apply_filters( 'rew_filter_anonymous_post_data', $retval, $r ); }February 13, 2017 at 10:17 pm #181603In reply to: disable email Email (required) config ?
crewockeez
Participantno insert code on fuctions file. on site error
add_filter ('bbp_filter_anonymous_post_data' , 'rew__filter_anonymous_post_data' 10, 2) ; function rew_filter_anonymous_post_data( $retval, $r ) { // Filter variables and add errors if necessary $r['bbp_anonymous_name'] = apply_filters( 'bbp_pre_anonymous_post_author_name', $r['bbp_anonymous_name'] ); if ( empty( $r['bbp_anonymous_name'] ) ) bbp_add_error( 'bbp_anonymous_name', __( '<strong>ERROR</strong>: Invalid author name submitted!', 'bbpress' ) ); // Website is optional $r['bbp_anonymous_website'] = apply_filters( 'bbp_pre_anonymous_post_author_website', $r['bbp_anonymous_website'] ); // Return false if we have any errors $retval = bbp_has_errors() ? false : $r; // Finally, return sanitized data or false return apply_filters( 'bbp_filter_anonymous_post_data', $retval, $r ); }February 13, 2017 at 5:28 pm #181598In reply to: disable email Email (required) config ?
Robin W
Moderatoruntested, but try adding this to your functions file
add_filter ('bbp_filter_anonymous_post_data' , 'rew__filter_anonymous_post_data' 10, 2) ; function rew_filter_anonymous_post_data( $retval, $r ) { // Filter variables and add errors if necessary $r['bbp_anonymous_name'] = apply_filters( 'bbp_pre_anonymous_post_author_name', $r['bbp_anonymous_name'] ); if ( empty( $r['bbp_anonymous_name'] ) ) bbp_add_error( 'bbp_anonymous_name', __( '<strong>ERROR</strong>: Invalid author name submitted!', 'bbpress' ) ); // Website is optional $r['bbp_anonymous_website'] = apply_filters( 'bbp_pre_anonymous_post_author_website', $r['bbp_anonymous_website'] ); // Return false if we have any errors $retval = bbp_has_errors() ? false : $r; // Finally, return sanitized data or false return apply_filters( 'bbp_filter_anonymous_post_data', $retval, $r ); }February 13, 2017 at 1:53 pm #181591In reply to: disable email Email (required) config ?
Robin W
ModeratorThis is in a file called form-anonymous.php :
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
find
wp-content/plugins/bbpress/templates/default/bbpress/form-anonymous.php
Make a copy of this file, and put in in the directory called bbpress that you created above, so you end up with
wp-content/themes/%your-theme-name%/bbpress/form-anonymous.php
bbPress will now use this template instead of the original
and you can amend thisyou will see that lines 26-29 contain
<p> <label for="bbp_anonymous_email"><?php _e( 'Mail (will not be published) (required):', 'bbpress' ); ?></label><br /> <input type="text" id="bbp_anonymous_email" value="<?php bbp_author_email(); ?>" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_anonymous_email" /> </p>Just delete this and save, and this field will not be shown
February 12, 2017 at 5:23 am #181501phil49
ParticipantHi,
Just a question: how can I know which page model is being used by the forum pages ?
Is there a way to know it through the dashboard or inspecting the source code ?
Regards
Philippe
February 11, 2017 at 3:11 pm #181492Robin W
Moderatorhave you been through no. 8 in this link
February 11, 2017 at 2:23 pm #181489Md Sadiqur Rahman
Participantbbp additional shortcodes plugin solved the problem 🙂
February 11, 2017 at 1:50 pm #181488Md Sadiqur Rahman
ParticipantHi,
I’m using [bbp-single-forum id=#] shortcode to show forum under a certain category. Above it, there is a status bar (counts topics and replies). It is not fitting with my homepage. Is there a way to delete it?Screenshot:https://www.dropbox.com/s/52kip18610x7iu7/forum-1.png?dl=0
February 11, 2017 at 12:43 pm #181486In reply to: Make the forum in read-only mode
Stiofan
Participanti had to do this today for a few hours, only hidden with CSS and message displayed but might help someone:
// put forum in read only mode add_action('bbp_theme_after_reply_form','gd_bbp_read_only_mode'); add_action('bbp_theme_after_topic_form','gd_bbp_read_only_mode'); function gd_bbp_read_only_mode(){ ?> <style> fieldset.bbp-form{ display: none;} </style> <div style="background: red;color: white;"><h2>The forum is currently in read only mode while we perform some maintenance, this should only take a few hours.</h2></div> <?php }February 11, 2017 at 12:33 pm #181485phil49
ParticipantHi
I’ve been reading many posts on this forum and tried out many proposed solutions but to no avail up to now 🙁
I first started with the copy of an unmodified and renamed in “bbpress.php” “page.php” file at the root of my theme folder, then with another one with a slight modification of the code substituting the class “content-area”with “content-area-wide”, I then tried another method creating a subfolder in my theme and copying the above mentioned file as well as a modified “style.css” file.
The code was simply :
.content-area-wide {
float: left; margin-right: -100%; width: 100%}
@import url (“../twentyseventeen/style.css”);Unless the code is not correct or the path or it’s syntax either, of course it didn’t work either.
Surprisingly, the page listing all the forums is using almost the full width, and looks exactly what I’m looking for anyway but as son as I get in one of the forums they are displayed as if on one column way and aligned on the left.
Same thing for the abovementioned page if I go back to it unless I refresh it…
I should point out that I don’t use or have any sidebar for these pages and I’m not concerned by this kind of problem like many other people!
As I’m not a master of the code, could anybody help me and describe each step to solve this frustrating issue so that I can follow each step and not guess intermediate steps considered as obvious are easy by the most learned guys !?Thanks so much for our site subscribers
Regards,
Philippe
February 10, 2017 at 2:45 pm #181464In reply to: Change the font size of the title of the forum
February 10, 2017 at 8:27 am #181446In reply to: Only pin post is showing
en10
ParticipantOK, I found the code who make this issue.
function SearchFilter($query) { if ( $query->is_search && !is_woocommerce() && !is_admin()) { $query->set( 'post_type', 'post,page' ); } if ( function_exists( 'is_woocommerce' ) ) : if ( $query->is_search && is_woocommerce() && !is_admin()) { $query->set( 'post_type', 'product' ); } endif; return $query; } add_filter('pre_get_posts','SearchFilter');I put this function in functions.php because without that I can’t search on my blog AND Woocommerce with the plugin Releanssi).
But what the problem with this function?
EDIT: I found a topic and the fix of @robin-w
I will try this fix very soon.
-
AuthorSearch Results