Search Results for 'code'
-
AuthorSearch Results
-
August 20, 2023 at 6:06 pm #236980
newtech1
ParticipantI am wanting my bbpress tags and bbpress search input form to display on my forum main page just below the bread crumbs.
This is what I understand to do.
A. Copy my page.php template from by theme folder. (..//wp-content/themes/fishingclub)
B. Rename it bbpress.php and upload to the theme folder.
(I do this and the forum main page displays properly.)
Here is the page,php code:<?php /** * The template for displaying all single pages * * @package WordPress * @subpackage FISHING_CLUB * @since FISHING_CLUB 1.0 */ get_header(); while ( have_posts() ) { the_post(); get_template_part( 'content', 'page' ); // If comments are open or we have at least one comment, load up the comment template. if ( !is_front_page() && ( comments_open() || get_comments_number() ) ) { comments_template(); } } get_footer(); ?>
C. Since I want to display bbpress tags and bbpress I need to put these shortcodes in the bbpress.php template: [bbp-topic-tags] and [bbp-search], BUT the page crashes no matter where I put the shortcode.
D. I assume I must put some kind of coding before and after the shortcode. No idea what I need to do.August 20, 2023 at 4:15 pm #236979Topic: Hide posts number
in forum Installationnewtech1
ParticipantI have removed the column titled ‘voices’ by this code in custom css:
li.bbp-topic-voice-count { display: none !important; }
I want to hide the column with the title ‘Posts’. Is there a way to do this also via custom css?
August 20, 2023 at 3:24 am #236976In reply to: bbPress interferes with wpForms User Registration
Robin W
Moderatorok, for the moment, I’d suggest you add the code snippets plugin, that gives you an area to put it in.
That will let us test to get to a problem definition.
Once we know if this (or something else) is the solution, then we can get it into the right place, but I would prefer to be sure that the code is functioning so code snippets gives that certainty
August 19, 2023 at 7:20 pm #236975In reply to: bbPress interferes with wpForms User Registration
waprothero
ParticipantRobin, thanks for your response. I’m out of town until Monday and will try out your suggestions then. Some quick question tho. I’m an experienced programmer, but not with wordpress. I’m unclear where to insert these code items. So….
_———-here’s your suggestion
so use this code—where do I add this this.. To the bbPress functions file?
add_action (‘plugins_loaded’ , ‘rew_remove_bbp_role’) ;function rew_remove_bbp_role () {
remove_action( ‘bbp_user_register’, ‘bbp_user_add_role_on_register’, 10, 1 );
}Put this in your child theme’s function file –
I am guessing this goes in wp initiation file.ie wp-content/themes/%your-theme-name%/functions.php
where %your-theme-name% is the name of your theme
August 19, 2023 at 3:51 am #236974In reply to: bbPress interferes with wpForms User Registration
Robin W
Moderatoras a test, let’s stop it adding the forum role on registration to see if that is interfering.
so use this code
add_action ('plugins_loaded' , 'rew_remove_bbp_role') ; function rew_remove_bbp_role () { remove_action( 'bbp_user_register', 'bbp_user_add_role_on_register', 10, 1 ); }
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
and then let me know if this makes a difference
August 19, 2023 at 3:25 am #236973In reply to: Trouble with font color
Robin W
Moderatorok, but it is the equivalent of asking me to diagnose the strange sound of your car by sending me a photo of the engine. A link lets me see what code is being sent to the browser.
Topics are typically greyed when they are closed – what state is this topic, and have you tried creating others to see if it is juts this one, or all topics are doing it?
August 18, 2023 at 1:19 pm #236957In reply to: Prevent topic replies
Robin W
Moderatorand with this one try
content-single-topic.php
and remove the line
<?php bbp_get_template_part( 'form', 'reply' ); ?>
August 18, 2023 at 1:17 pm #236956In reply to: Remove topic creation in frontend
Robin W
Moderatorok, not quite sure why, but in that case
find
wp-content/plugins/bbpress/templates/default/bbpress/content-single-forum.phptransfer this to your pc and edit
take out the line
<?php bbp_get_template_part( 'form', 'topic' ); ?>
which is in twice, so remove 2 times
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
August 18, 2023 at 1:14 pm #236955In reply to: Prevent topic replies
newtech1
ParticipantAre you saying to replace the existing code in form-reply.php just with this code? If so my forum page is ‘page not found’.
<?php /** * New/Edit reply * * @package bbPress * @subpackage Theme */ // Exit if accessed directly defined( 'ABSPATH' ) || exit;
I believe this shoudk end with
<?
but it still does not work.August 18, 2023 at 1:10 pm #236954In reply to: Remove topic creation in frontend
newtech1
ParticipantAre you saying that I am to replace all of the code in form-topic.php with just this code:
`<?php/**
* New/Edit Topic
*
* @package bbPress
* @subpackage Theme
*/// Exit if accessed directly
defined( ‘ABSPATH’ ) || exit;if ( ! bbp_is_single_forum() ) : ?>
<div id=”bbpress-forums” class=”bbpress-wrapper”>
</div>
<?php endif;’
If so the when I go to my forum page it says ‘page not found’.
August 18, 2023 at 12:13 pm #236953In reply to: Prevent topic replies
Robin W
Moderatorfind
wp-content/plugins/bbpress/templates/default/bbpress/form-reply.phptransfer this to your pc and edit
make the file read
<?php /** * New/Edit reply * * @package bbPress * @subpackage Theme */ // Exit if accessed directly defined( 'ABSPATH' ) || exit;
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/form-reply.phpbbPress will now use this template instead of the original
August 18, 2023 at 12:08 pm #236951In reply to: Remove topic creation in frontend
Robin W
Moderatorfind
wp-content/plugins/bbpress/templates/default/bbpress/form-topic.phptransfer this to your pc and edit
make the file read
<?php /** * New/Edit Topic * * @package bbPress * @subpackage Theme */ // Exit if accessed directly defined( 'ABSPATH' ) || exit; if ( ! bbp_is_single_forum() ) : ?> <div id="bbpress-forums" class="bbpress-wrapper"> </div> <?php endif;
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/form-topic.phpbbPress will now use this template instead of the original
August 18, 2023 at 11:47 am #236949In reply to: Prevent topic replies
newtech1
ParticipantI need to clarify. I do not want the reply option to appear anywhere in the forum. I do not want the option for replies-just turn off the reply feature.
If I cannot turn off the reply form what file do I go into to remove the code for the reply form so it does not show up?
The problem with making topic closed is it greys out the topic title. I do not want the title to grey out. So if I cannot remove the reply form someway how can I prevent the title from turning grey when closed?
August 18, 2023 at 11:40 am #236948Topic: Remove topic creation in frontend
in forum Installationnewtech1
ParticipantI do not want anyone, including members, to be able to post topics on the frontend of the forum, just through backdoor. How do I remove that option? It appears the code is form-forum.php file but cannot determine what code I need to remove. What I have tried keeps giving me ‘page not found’.
August 18, 2023 at 2:05 am #236946In reply to: a user login problem
Passepoil
ParticipantHello Robin,
Yes, the site is under development.
I’m thinking of creating a specific button for logging into the account and redirecting the Internet user to the home page afterwards.
I realized that the connection was done well by changing the page afterwards but not on the page where the widget is installed.
Maybe there is a trick (php code in functions.php) to work around this problem?
Thanks for your help.August 16, 2023 at 1:10 pm #236932In reply to: Moderator can only trash his own posts
Robin W
Moderatoryou’re close !!
Untested, but try
add_filter('bbp_topic_admin_links', 'rew_no_trash_topic_except_own', 10, 2); add_filter('bbp_reply_admin_links', 'rew_no_trash_reply_except_own', 10, 2); function rew_no_trash_topic_except_own ($links, $topic_id) { if (!bbp_is_user_keymaster() && get_current_user_id() != bbp_get_topic_author_id( $topic_id )) { unset($links['trash']); } return $links; } function rew_no_trash_reply_except_own ($links, $reply_id) { if (!bbp_is_user_keymaster() && get_current_user_id() != bbp_get_reply_author_id( $reply_id )) { unset($links['trash']); } return $links; }
August 16, 2023 at 12:27 pm #236931In reply to: Moderator can only trash his own posts
enkoes
ParticipantToday tried testing this very ‘rough’ piece of code, failed hopelessly with my very limited knowledge of coding:
add_filter('bbp_topic_admin_links', 'rew_no_trash_except_own', 10, 2); add_filter('bbp_reply_admin_links', 'rew_no_trash_except_own', 10, 2); function rew_no_trash_except_own ($links, $topic_id) { if (!bbp_is_user_keymaster() && !bbp_is_topic_author(get_current_user_id(), $topic_id)) { unset($links['trash']); } return $links; }
I think the direction is somewhat correct. Hope to get expert guide on this issue.
Regards.
August 12, 2023 at 9:46 pm #236868Topic: Moderator can only trash his own posts
in forum Troubleshootingenkoes
ParticipantHi, good day!
How can we come up with a code so that moderators can only trash his OWN topic/reply but not those posted by others? i.e. to hide admin link “bin” for topic/reply posted by others but display “bin” for his own (as moderator) post.
Regards.
August 12, 2023 at 1:48 pm #236865In reply to: Title characters increased by more than 80
Robin W
Moderatoradd_filter ('bbp_get_title_max_length' , 'rew_change_length') ; function rew_change_length () { $length = 160 ; return $length ; }
so change length to whatever number you want.
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
August 11, 2023 at 4:38 pm #236860In reply to: Disable “edit” link and function on user´s page
Robin W
ModeratorIf you know enough to FTP a file, then
find
wp-content/plugins/bbpress/templates/default/bbpress/user-details.phptransfer this to your pc and edit
remove lines 72-76 ie these :
<li class="<?php if ( bbp_is_single_user_edit() ) :?>current<?php endif; ?>"> <span class="bbp-user-edit-link"> <a href="<?php bbp_user_profile_edit_url(); ?>" title="<?php printf( esc_attr__( "Edit %s's Profile", 'bbpress' ), bbp_get_displayed_user_field( 'display_name' ) ); ?>"><?php esc_html_e( 'Edit', 'bbpress' ); ?></a> </span> </li>
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/user-details.phpbbPress will now use this template instead of the original
August 11, 2023 at 12:59 pm #236859In reply to: Replace topic subscription text
Robin W
ModeratorThe way subscriptions works has changed
use this code now :
add_filter ('bbp_before_get_user_subscribe_link_parse_args' , 'change_subscribe') ; function change_subscribe ($args) { $post_id = $args['object_id'] ; if (bbp_is_topic( $post_id )) $text = 'topic' ; if (bbp_is_forum( $post_id )) $text = 'forum' ; $args['subscribe'] = 'Subscribe to this '.$text ; $args['unsubscribe'] = 'Unsubscribe' ; return $args ; }
August 11, 2023 at 12:58 pm #236858In reply to: Change subscription text
Robin W
ModeratorThe way subscriptions works has changed
use this code now :
add_filter ('bbp_before_get_user_subscribe_link_parse_args' , 'change_subscribe') ; function change_subscribe ($args) { $post_id = $args['object_id'] ; if (bbp_is_topic( $post_id )) $text = 'topic' ; if (bbp_is_forum( $post_id )) $text = 'forum' ; $args['subscribe'] = 'Subscribe to this '.$text ; $args['unsubscribe'] = 'Unsubscribe' ; return $args ; }
August 11, 2023 at 9:13 am #236855Topic: Change subscription text
in forum Troubleshootingenkoes
ParticipantHi, I’m using the code below to change text of topic subscription link (referring to this topic)
add_filter ('bbp_before_get_topic_subscribe_link_parse_args' , 'change_topic_subscribe') ; function change_topic_subscribe ($args) { $args['subscribe'] = 'Subscribe to this topic' ; $args['unsubscribe'] = 'Unsubscribe' ; return $args ; }
But it does not work in forum subscription text:
add_filter ('bbp_before_get_forum_subscribe_link_parse_args' , 'change_forum_subscribe') ; function change_forum_subscribe ($args) { $args['subscribe'] = 'Subscribe to this forum' ; $args['unsubscribe'] = 'Unsubscribe' ; return $args ; }
Anyone can guide me on this?
Regards.
August 7, 2023 at 7:16 pm #236806In reply to: ACF shortcode in topic post frontend
newtech1
ParticipantI found a code that works when inserted into …/wp-content/plugins/bbpress/templates/default/bbpress
<h6>Date: <?php the_field( ‘date’ ) ; ?></h6>
<h6>Fish Caught: <?php the_field( ‘fish_caught’ ) ; ?></h6>
<h6>Speed: <?php the_field( ‘speed’ ) ; ?></h6>But it only displays if put in certain areas. Here is the closet area it displays to the topic content.
<?php bbp_single_topic_description(); ?>
<h6>Date: <?php the_field( ‘date’ ) ; ?></h6>
<h6>Fish Caught: <?php the_field( ‘fish_caught’ ) ; ?></h6>
<h6>Speed: <?php the_field( ‘speed’ ) ; ?></h6>
<h6>Water Features: <?php the_field( ‘water_features’ ) ; ?></h6>
<h6>Lure & Color: <?php the_field( ‘lure_color’ ) ; ?></h6><?php if ( bbp_show_lead_topic() ) : ?>
<?php bbp_get_template_part( ‘content’, ‘single-topic-lead’ ); ?>
I have tried putting it below either of these items and it will not dislay in the frontend.
<?php if ( bbp_show_lead_topic() ) : ?>
<?php bbp_get_template_part( ‘content’, ‘single-topic-lead’ ); ?
From what I can tell the code actually needs to be inserted in the single-topic-lead. I have tired inserting it everywhere within the single-topic-lead.php page but no matter where I put it, it does not show up. Here is where I think it needs to go:
<?php bbp_topic_author_link( array( ‘show_role’ => true ) ); ?>
<?php if ( current_user_can( ‘moderate’, bbp_get_reply_id() ) ) : ?>
<?php do_action( ‘bbp_theme_before_topic_author_admin_details’ ); ?>
<div class=”bbp-topic-ip”><?php bbp_author_ip( bbp_get_topic_id() ); ?></div>
<?php do_action( ‘bbp_theme_after_topic_author_admin_details’ ); ?>
<?php endif; ?>
<?php do_action( ‘bbp_theme_after_topic_author_details’ ); ?>
</div><!– .bbp-topic-author –>
<div class=”bbp-topic-content”>
<?php do_action( ‘bbp_theme_before_topic_content’ ); ?>
<?php bbp_topic_content(); ?>
<h6>Date: <?php the_field( ‘date’ ) ; ?></h6>
<h6>Fish Caught: <?php the_field( ‘fish_caught’ ) ; ?></h6>
<h6>Speed: <?php the_field( ‘speed’ ) ; ?></h6>
<h6>Water Features: <?php the_field( ‘water_features’ ) ; ?></h6>
<h6>Lure & Color: <?php the_field( ‘lure_color’ ) ; ?></h6>
<?php do_action( ‘bbp_theme_after_topic_content’ ); ?>
</div><!– .bbp-topic-content –>
</div><!– #post-<?php bbp_topic_id(); ?> –>NOTE: What is strange is that if I delete the content-single-topic-lead.php file to make sure the page is not cached, it does not break the topic post which makes no sense to me.
Here is the actual topics page:https://thedoverfamily.com/gfwc/forums/topic/last-try/
August 7, 2023 at 5:50 pm #236805In reply to: ACF shortcode in topic post frontend
newtech1
ParticipantThe code you gave me to insert into functions.php causes a fatal crash.
-
AuthorSearch Results