Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 576 through 600 (of 32,468 total)
  • Author
    Search Results
  • newtech1
    Participant

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

    #236979
    newtech1
    Participant

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

    #236976
    Robin W
    Moderator

    ok, 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

    #236975
    waprothero
    Participant

    Robin, 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

    #236974
    Robin W
    Moderator

    as 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

    Code Snippets

    and then let me know if this makes a difference

    #236973
    Robin W
    Moderator

    ok, 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?

    #236957

    In reply to: Prevent topic replies

    Robin W
    Moderator

    and with this one try

    content-single-topic.php

    and remove the line

    <?php bbp_get_template_part( 'form', 'reply' ); ?>

    #236956
    Robin W
    Moderator

    ok, not quite sure why, but in that case

    find
    wp-content/plugins/bbpress/templates/default/bbpress/content-single-forum.php

    transfer 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%/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/content-single-forum.php

    bbPress will now use this template instead of the original

    #236955

    In reply to: Prevent topic replies

    newtech1
    Participant

    Are 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.

    #236954
    newtech1
    Participant

    Are 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’.

    #236953

    In reply to: Prevent topic replies

    Robin W
    Moderator

    find
    wp-content/plugins/bbpress/templates/default/bbpress/form-reply.php

    transfer 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%/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/form-reply.php

    bbPress will now use this template instead of the original

    #236951
    Robin W
    Moderator

    find
    wp-content/plugins/bbpress/templates/default/bbpress/form-topic.php

    transfer 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%/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/form-topic.php

    bbPress will now use this template instead of the original

    #236949

    In reply to: Prevent topic replies

    newtech1
    Participant

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

    closed topic

    #236948
    newtech1
    Participant

    I 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’.remove front end posting

    #236946

    In reply to: a user login problem

    Passepoil
    Participant

    Hello 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.

    #236932
    Robin W
    Moderator

    you’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;
    }
    #236931
    enkoes
    Participant

    Today 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.

    #236868
    enkoes
    Participant

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

    #236865
    Robin W
    Moderator
    add_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

    Code Snippets

    #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.

Viewing 25 results - 576 through 600 (of 32,468 total)
Skip to toolbar