Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 476 through 500 (of 32,358 total)
  • Author
    Search Results
  • #236860
    Robin W
    Moderator

    If you know enough to FTP a file, then

    find
    wp-content/plugins/bbpress/templates/default/bbpress/user-details.php

    transfer 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%/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/user-details.php

    bbPress will now use this template instead of the original

    #236859
    Robin W
    Moderator

    The 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 ;
    }
    #236858
    Robin W
    Moderator

    The 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 ;
    }
    #236855
    enkoes
    Participant

    Hi, 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.

    #236806
    newtech1
    Participant

    I 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/

    #236805
    newtech1
    Participant

    The code you gave me to insert into functions.php causes a fatal crash.

    #236799
    newtech1
    Participant

    A. I am getting to a fix to custom fields showing up in frontend on forum topics.
    Here is a code that is working to an extent.

    <h2>Anglers: <?php the_field(‘anglers’) ; ?></h2>

    If I go to content-single-topic.php and I insert in either of these thre places it shows up in the frontend:

    <?php else : ?>
    <h2><?php the_field(‘anglers’) ; ?></h2>

    <?php bbp_topic_tag_list(); ?>
    <h2><?php the_field(‘anglers’) ; ?></h2>
    <?php bbp_single_topic_description(); ?>
    <h2><?php the_field(‘anglers’) ; ?></h2>
    <?php if ( bbp_show_lead_topic() ) : ?>
    <?php bbp_get_template_part( ‘content’, ‘single-topic-lead’ ); ?>
    <?php endif; ?>

    If I put the code after <?php bbp_get_template_part( ‘content’, ‘single-topic-lead’ ); ?> it does not show up.

    B. After reviewing this code in content-single-topic.php, It appears I need to enter my custom field code in the single-topic-lead’ file. The reason I know this is if I delete

    <?php bbp_get_template_part( ‘content’, ‘single-topic-lead’ ); ?>

    in content-single-topic.php I ‘break’ the topic post page. However, to verify that I need to enter my custom field code into content-single-topic-lead.php I deleted the file from the server. Much to my surprise the topic content still shows up on the topic page. How can that be. I have cleared cache on my browser, tried different browsers, different computers and get same results. Any ideas?

    #236796
    newtech1
    Participant

    I have added the following code into content-single-topic.php and the custom field does not show up in the topic contents on the front end.

    <div class=”acf-view acf-view–id–151 acf-view–object-id–{object-id}”>

    <!–$anglers$–>
    <div class=”acf-view__row acf-view__anglers”>
    <div class=”acf-view__label”>Anglers</div>
    <div class=”acf-view__field”>$anglers$</div>
    </div>
    <!–$anglers$–>
    </div>

    [acf_views view-id=”151″ name=”Anglers”]

    [acf_views view-id=”151″ object-id=”ANOTHER_POST_ID” name=”Anglers”]

    #236795
    newtech1
    Participant

    From what I can tell it looks like this is the file I need to edit:
    content-single-topic.php
    But when I put the following code, nothing show ups on the frontend.

    echo ‘Anglers: ‘ .get_field( ‘anglers’ );
    echo ‘<br>Catch Date: ‘ .get_field( ‘date’ );
    echo ‘<br>Time of Day: ‘ .get_field( ‘time’ );

    Is this for sure the file that needs to be edited to show custom fields on the frontend?
    If so, anybody have any idea of what code I should use? Again ACH says they do support other plugins so they will not help me out.

    #236794
    newtech1
    Participant

    I am wanting custom fields to show up when a user posts a topic in the forum. I am using ACF because it is suppose to be compatible with bbpress. The support team tells me I must contact bbpress for my current issue.

    I have uses ACF plugin to create custom fields. On the backend the custom fields show up if a user posts a new topic in the backend. The custom fields do not show up if the user posts a new topic in the frontend. Even though the custom fields show up in the backend, when the user posts the topic, the custom fields do not show up in the frontend. (I know the following code is correct because the custom fields will show up on the page in the frontend.

    Here is the code for the custom fields to display on front end:

    echo ‘Anglers: ‘ .get_field( ‘anglers’ );
    echo ‘<br>Catch Date: ‘ .get_field( ‘date’ );
    echo ‘<br>Time of Day: ‘ .get_field( ‘time’ );

    Questions:
    A. What bbpress file do I enter this into so it will show up on the frontend of a topic?
    B. What bbpress file do I enter this into so it will show when a user posts a new topic on the frontend, not the backend?

    #236792
    newtech1
    Participant

    Did you figure out how to put custom fields within each topic post? I am trying to do so using the ACF plugin. Thus far I have been able to use ACF to put custom fields when a user logins and goes to dashboard post a topic. BUT I cannot get their answers to display within the frontend.

    Here is the code but (I know it is correct because it will show up if I enter it in the page.php. Just do not know what forum page to insert code.

    echo ‘Anglers: ‘ .get_field( ‘anglers’ );
    echo ‘<br>Catch Date: ‘ .get_field( ‘date’ );
    echo ‘<br>Time of Day: ‘ .get_field( ‘time’ );
    echo ‘<br>Fish Caught: ‘ .get_field( ‘fish_caught’ );
    echo ‘<br>Lake Point MarkerMarker: ‘ .get_field( ‘lake_point_marker’ );
    echo ‘<br>Water Features: ‘ .get_field( ‘water_features’ );
    echo ‘<br>Speed: ‘ .get_field( ‘speed’ );
    echo ‘<br>Fish Depth: ‘ .get_field( ‘fish_depth’ );
    echo ‘<br>Lake Depth: ‘ .get_field( ‘lake_depth’ );
    echo ‘<br>Method Used: ‘ .get_field( ‘method_used’ );
    echo ‘<br>Lures & colors: ‘ .get_field( ‘lure_color’ );

    #236791
    Robin W
    Moderator

    so what is the code that does this?

    #236783
    StudentFilmmakers
    Participant

    I am trying to move my site off Buddyboss back to buddypress and bbpress. I can’t get all my forums to show from my groups on my forums page. Also, it’s a bit strange that it will only post 8 forums on the page. I can get forums to show if I change the order of the forums in the forum list, but it will remove the last forum on the list so that there are only 8. Does anyone have any tips and resetting the code, core or getting it to work? It’s on a staging site so I can try different things. Any help is appreciated.

    #236780
    Robin W
    Moderator

    I just rescued the ‘unread’ part of someone else’s plugin into style pack when it became too old in the main plugins. I only looked at the code in enough detail to get it working in style pack.

    If pencil unread does what you want, then use it.

    Also, the plugin bbpress pencil unread had a very useful option that marked all post shared before the date of register as read. Which makes sense by the way.

    And, why there isn’t an option where we can choose where to have the unread icon?

    Like many plugin authors, I’m just a guy who writes free code for the challenge and enjoyment. It would take a day of my life to code those changes, so whilst I agree that they might be useful, I have to find enough fun to do this. At the moment it’s not a change I am planning, sorry 🙁

    #236763
    enkoes
    Participant

    Simple codes do the tricks. Thanks for your kind support!

    #236761
    Robin W
    Moderator

    the keymaster function was wrong, revised code is above.

    #236760
    enkoes
    Participant

    Thanks for replying me on yr holiday. 🙂

    I applied yr given code with minor correction of syntax error:
    unset($r['close']) ;

    The code however return generic critical error message in the webpage. Anything wrong?

    Regards

    #236750
    tapiohuuhaa
    Participant

    My GD bbPress Toolbox Pro plugin has 50 major new features, including BBCodes implementation that has 40+ shortcodes/BBCodes for bbPress forums, including SPOILER and HIDE, as well as full syntax highlighting SCODE shortcode.

    I looked your pro plugin. Does your additions work with TinyMCE, text editor or both text and graphic editor? For me your BBCode- support is unnecessary wide. I try to find where TinyMCE defines how to print strikeout. I creates DEL-tags. I would just like to replace DEL-tags with SPOILER-tags as I dId for the text editor.
    I found translation. With CSS I can change the text and icon. Dashicon f177 is closest available. With CSS can change the text just defining the font-size of the text 0 an replacing text by using the ::before pseudo-class.

    #236749
    Robin W
    Moderator

    on holiday at the moment, so untested solution !!

    But try

    add_filter( 'bbp_topic_admin_links' , 'rew_no_close', 10 , 1) ;
    
    function rew_no_close ($r) {
    	if (!bbp_is_user_keymaster() && bbp_is_topic_open()) {
    		unset ($r['close']) ;
    	}
    return $r ;
    }

    This should ensure that only keymasters can close topics (assumes moderators have no backend access)

    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

    #236737

    Topic: Custom Login

    in forum Installation
    teksmith
    Participant

    I am hoping someone can answer this, I just started with BBPress for a charity gig, and they want a custom login so the user have to give name address and postcode to confirm they are based within the country and thus should be permitted to join

    then assign the user a unique six digit ID so they can vote on concerns in the local community

    is this something bbpress can do

    #236727
    valvatine
    Participant

    Hello,

    I created a bbpress forum on this site that is just available for approved members.

    When I click on user profile links, I obtain the following error:
    Sorry, but the page you were trying to view does not exist.
    It looks like this was the result of either a mistyped address or an out-of-date link
    .

    So, I would like to know how I can create the topics started page and others page displayed on user profile page. Is there any shortcode to do that or any other solutions?

    Thanks in advance for your help!

    I am keymaster on the website but I dont have access to source code of the site. I am using WordPress 6.2.2, bbpress Version 2.6.9.

    #236670
    wmasat
    Participant

    I have a buddypress with a theme(youzify), I want to display activitys posts randomly on the wall, anyone knows any code, plugin or method for that

    ilyessd
    Participant

    Hi, I tried to add the code snippet to my forum and as you can see on this page, the freshness is still appearing while it’s not on pc. Do you know how to fix this please ?

    #236661
    chuckbevitt1
    Participant

    I was just about to post for a problem where some shortcodes were not working, when I actually READ THE POSTING INSTRUCTIONS! (Who would think?)

    My problem was that the [bbp-register], [bbp-lost-pass], and [bbp-login] shortcodes weren’t working. The page / block with the shortcode was simply blank.

    Per the ‘Before Posting’ topic, I switched my theme to Twenty Twelve. Poof! It all worked. So try that before digging deeper.

    https://SolarGeoEngineeringNow.org

    #236643
    Robin W
    Moderator

    just got 10 minutes to look at this.

    try this

    add_action ('bbp_theme_after_reply_content' , 'rew_display_acf') ;
    
    function rew_display_acf () {
    	$id = bbp_get_reply_id() ;
    	//if it is the topic...
    	if (bbp_is_topic( $id ) {
    		echo '<br>Lake Marker 2: ' .get_field( 'lake_marker_point_2' ) ;
    	}
    }

    or

    add_action ('bbp_theme_after_reply_content' , 'rew_display_acf') ;
    
    function rew_display_acf () {
    	$id = bbp_get_reply_id() ;
    	//if it is the topic...
    	if (bbp_is_topic( $id ) {
    		echo '<br>Lake Marker 2: ' .get_field( 'lake_marker_point_2', $id ) ;
    	}
    }

    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

Viewing 25 results - 476 through 500 (of 32,358 total)
Skip to toolbar