Search Results for 'code'
-
AuthorSearch Results
-
March 27, 2021 at 6:19 pm #219548
In reply to: bbpress + divi template questions
b0nkers2021
ParticipantThanks for the quick reply.
I used to mod forums and CMS’s before WP existed and have not done much since… so I ‘get it’ but don’t know enough to just whip up a bunch of code. haven’t touched PHP but can get through HTML. Would editing the file not also change the layout etc of other pages within the theme or is the forum using something dedicated to it and it only? Essentially, I need to make the forum look like an existing site and change the header at minimum.
March 27, 2021 at 5:10 pm #219547In reply to: bbpress + divi template questions
Robin W
Moderatorbbpress will render pages using a .php file – this can be one of many in your theme.
It is this file that you will need to edit and put in a child theme to get what you want.
so how familiar with files, FTP and code are you ?
March 27, 2021 at 5:07 pm #219546In reply to: custom post type in bbpress forum board
Robin W
Moderatorfind
wp-content/plugins/bbpress/templates/default/bbpress/loop-single-reply.phptransfer this to your pc and edit
before line 56 which says
<?php do_action( 'bbp_theme_after_reply_author_details' ); ?>
add the following
<?php echo 'hello' ; ?>
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/loop-single-reply.phpbbPress will now use this template instead of the original
You should now see ‘hello’ where you want the neighborhood field
If you get this far, then come back
March 27, 2021 at 5:03 pm #219545In reply to: Replace topic subscription text
Robin W
Moderatorok, try this
add_filter( 'gettext', 'rew_change_text', 20, 3 ); //This function changes the text wherever it is quoted function rew_change_text( $translated_text, $text, $domain ) { if ( $text == 'Subscribe' ) { $translated_text = 'Watch'; } if ( $text == 'Unsubscribe' ) { $translated_text = 'Unwatch'; } return $translated_text; }
March 27, 2021 at 2:32 pm #219542In reply to: Replace topic subscription text
vincenzon617
ParticipantThanks, the code works however only when loading onto the page. When I click to either ‘Watch’ or ‘Unwatch’ the text reverts back to ‘Unsubscribe’ or ‘Subscribe’ until I refresh the page again.
March 27, 2021 at 2:24 pm #219541In reply to: Replace topic subscription text
Robin W
Moderatoruntested, but this should work
add_filter ('bbp_before_get_topic_subscribe_link_parse_args' , 'change_subscribe') ; function change_subscribe ($args) { $args['subscribe'] = 'Watch' ; $args['unsubscribe'] = 'Unwatch' ; return $args ; }
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
March 27, 2021 at 2:08 pm #219540Topic: Replace topic subscription text
in forum Installationvincenzon617
ParticipantHi,
is there a way to change the text of the subscription button? Currently it says ‘Subscribe’ and ‘Unsubscribe’ and I would like to change to ‘Watch’ and ‘Unwatch’ respectively. I believe the code that can change this is within the file \bbpress\includes\topics\template.php lines 1781 and 1782. I could change them in here but I would rather change them via my child theme if this is possible?
Thanks!
March 26, 2021 at 2:39 pm #219530In reply to: Hide breadcrumbs on home forum index
Robin W
Moderatortry
#post-2399 .bbp-breadcrumb { display: none; }
March 26, 2021 at 12:52 pm #219525In reply to: Forum root
Robin W
ModeratorAS far as I know this forum just uses the default.
There are no problems I know of in not using the prefix unless you have other plugins that use ‘topic’ and ‘reply’ as part of their permalinks.
So it is a matter of personal choice.
In my opinion, only site owners worry about what the url is !! When I am on any other site, I rarely look at the url, and if I am on say Amazon as I was a moment ago it looked like
https://www.amazon.co.uk/?ie=UTF8&tag=googhydr-21&hvadid=208892259274&hvpos=&hvexid=&hvnetw=g&hvrand=3531407930769062293&hvpone=&hvptwo=&hvqmt=b&hvdev=c&ref=pd_sl_9djqxtzprt_e
๐ ๐ ๐
March 22, 2021 at 6:30 pm #219420In reply to: Shortcodes not working (wp-poll)
cassel
ParticipantWhere do I set it to allow shortcodes to show inside bbpress posts?
March 22, 2021 at 8:39 am #219408In reply to: bbPress Topics for Posts comment
Robin W
Moderator‘If it is set to perfection more and more users will use it and the plugin will be active.’
I agree, but this is free software that I write in my spare time, I get no income for doing this, and have limited time to write code ๐
you should find the topic/reply in the dashboard if you have not permanently deleted it.
March 22, 2021 at 4:34 am #219403In reply to: BBPress user profile page is restricted !!!!
nayanboost
ParticipantAnd another thing, there are shortcodes on many pages. Just haven’t done anything with the profile page template.
March 22, 2021 at 4:12 am #219399In reply to: BBPress user profile page is restricted !!!!
Robin W
Moderatorjust yours, everyone’s, are you using a shortcode on a page?
March 21, 2021 at 2:25 pm #219391In reply to: Keep subscribers at frontend -redirect wp login
healtemple21
ParticipantWhen I paste the register code into the page, nothing shows up. When I duplicate the same window for the forum-index, that works, in the wp bakery software (changing only the code), nothing happens.
I hope this helps to clarify. Let me know, thank you for your help
RomanMarch 21, 2021 at 11:22 am #219385In reply to: Keep subscribers at frontend -redirect wp login
healtemple21
ParticipantGood Day, the shortcode bb-register , login and lost password aren’t working for me on WPBakery. Other bb shortcodes do work, such as bb-topic-index. Thank you for any assistance you can offer.
March 21, 2021 at 9:09 am #219383In reply to: Automatic subscribtion
Julia
ParticipantYou can customze two file form-reply.php and form-topic.php .
bbress> templates > default > form-topic.php at line 170
<input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox" value="bbp_subscribe" <?php bbp_form_topic_subscribed(); ?> /> โ <input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox"checked value="bbp_subscribe" <?php bbp_form_topic_subscribed(); ?> />
bbress> templates > default > form-reply.php at line 104
<input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox" value="bbp_subscribe"<?php bbp_form_topic_subscribed(); ?> /> โ <input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox"checked value="bbp_subscribe"<?php bbp_form_topic_subscribed(); ?> />
Then the topic and reply are automatically subscribed simply.
But the participant can uncheck the checkbox about subscription by himself.
If you do not want participant uncheck the checkbox, you can delete checkbox by CSS.Put these customized files in your child themeโs folder-bbpress.
March 21, 2021 at 7:20 am #219368In reply to: bbPress Topics for Posts comment
Ricsca2
ParticipantWhen topics are created in the forum this is the writing they have of defoult.
%excerpt<br />[See the full post at: <a href="%url">%title</a>]
Could you replace like this for all in the next plugin update which with extra space and bold is more visible?
%excerpt ...<br /><br /><b>See the full post at: <a href="%url">%title</a></b>
Thank you
March 20, 2021 at 11:21 am #219358In reply to: Edit the comment box size
juventino199
ParticipantThank you very much, the code works perfectly after placed in my child theme.
March 20, 2021 at 7:54 am #219357In reply to: Edit the comment box size
Robin W
Moderatorthis (untested) should work
add_filter ('bbp_after_get_the_content_parse_args', 'change_rows') ; function change_rows ($args) { if ($args['context'] == 'reply' ) { $args['textarea_rows'] = '6' ; } return $args ; }
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
March 20, 2021 at 3:13 am #219353quix8
ParticipantHello,
I want to add a back link to get back to the page where the bbp-single-forum shortcode was implemented. I currently still have the defaults settings and the forum root is “forum”. So I will only see the single forum but not the page I implemented the shortcode in.
I have more than 1 page with a forum, so I would need to define the wordpress root page for each forum, if it is not possible to detect this dynamically I guess.
Thanks for any help!
– Dennis
March 19, 2021 at 11:07 am #219342In reply to: Automatic subscribtion
Julia
ParticipantHow about this code?
type="checkbox" โใtype="checkbox"checked
You can customize the form-reply.php and form-topic.php .
<input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox"checked value="bbp_subscribe"<?php bbp_form_topic_subscribed(); ?> />
You can change the code simply and put both files in your child themeโs bbpress folder.
March 19, 2021 at 10:38 am #219341In reply to: How to enable Unsubscription link only to Topic ?
Julia
ParticipantYour code works quite well. How simple they are!
I tried to customize it , but I couldn’t. I couldn’t get strpos code.Thank you for your kindness.
March 19, 2021 at 7:41 am #219335In reply to: How to enable Unsubscription link only to Topic ?
Robin W
Moderatorwithout getting complicated, this will work quite well
add_filter ('bbp_get_topic_subscribe_link' , 'julia_unubsribe') ; function julia_unubsribe($retval) { if (strpos($retval, 'Subscribe') !== FALSE) { $retval = '' ; } return $retval ; }
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
it will let someone unsubscribe from a topic, but does let them re-subscribe if they stay within that topic (so if they click by mistake, they can unclick immediately) once they leave that topic, then they can’t subscribe, and they can’t subscribe to a topic that they are not subscribed to in the first place.
March 19, 2021 at 6:54 am #219330In reply to: How to enable Unsubscription link only to Topic ?
Julia
Participant‘reply page’ means content-single-topic.php .
<?php bbp_topic_subscription_link(); ?>
includes> topics > template.php
function bbp_topic_subscription_link( $args = array() ) { echo bbp_get_topic_subscription_link( $args ); } /** * Get the topic subscription link * * A custom wrapper for bbp_get_user_subscribe_link() * * @since 2.5.0 bbPress (r5156) * @since 2.6.0 bbPress (r6308) Add 'redirect_to' support */ function bbp_get_topic_subscription_link( $args = array() ) { // Defaults $retval = false; $user_id = bbp_get_current_user_id(); $redirect_to = bbp_is_subscriptions() ? bbp_get_subscriptions_permalink( $user_id ) : ''; // Parse the arguments $r = bbp_parse_args( $args, array( 'user_id' => $user_id, 'object_id' => bbp_get_topic_id(), 'object_type' => 'post', 'before' => ' | ', 'after' => '', 'subscribe' => esc_html__( 'Subscribe', 'bbpress' ), 'unsubscribe' => esc_html__( 'Unsubscribe', 'bbpress' ), 'redirect_to' => $redirect_to ), 'get_topic_subscribe_link' ); // Get the link $retval = bbp_get_user_subscribe_link( $r ); // Filter & return return apply_filters( 'bbp_get_topic_subscribe_link', $retval, $r, $args ); }
March 18, 2021 at 12:30 pm #219301In reply to: Styling pages made using the shortcode
Robin W
Moderatorbbpress has an ID not a class (you don’t need to know what this means!) , so try
body#bbpress .memberoni_breadcrumbs { display: none; }
-
AuthorSearch Results