Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 4,276 through 4,300 (of 32,481 total)
  • Author
    Search Results
  • #193154
    erichamm1996
    Participant

    Thank you MBV!
    I inserted the CSS below, and it worked!

    .comment-list .edit-link, .reply {
    	position: relative;
    	right: 0px;
    	top: 0px;
    }
    #193153
    cloe22
    Participant

    Hi there,

    I have been using wordpress for the last year. In October I took over the completion of a site for a company I am working for. I set up a forum on the website using bbpress. All has worked fine until recently. Yesterday my boss pointed out an error on the forums page. See error here

    I began trying to fix it by remaking the page, using different shortcodes and changing/refreshing settings. All my other shortcodes that I’m using on my website are working fine, and when I use a shortcode for a different plugin in the same place on this page, it works fine. The shortcode I have been using is [bbp-forum-index]. I don’t know what caused it to stop working, as I have not installed any new plugins since before it has stopped working.

    WordPress 4.9.6 running Sydney theme.

    #193150
    MBV
    Participant

    It’s because you have this conflicting CSS in your stylesheet, line 3023

    .comment-list .edit-link, .reply {
        position: absolute;
        right: 20px;
        top: 22px;
    }
    yso1
    Participant

    Fixed it myself. Extending on benklocek s code, and also translating, added to themes functions.php

    function my_custom_roles( $role, $user_id ) {
    if( $role == ‘Keymaster’ )
    return ‘Sjef’;

    if( $role == ‘Spectator’ )
    return ‘Observator’;

    if( $role == ‘Blocked’ )
    return ‘Utestengt’;

    if( $role == ‘Participant’ )
    return ‘Deltager’;

    return $role;
    }

    add_filter( ‘bbp_get_user_display_role’, ‘my_custom_roles’, 10, 2 );

    Peace!

    #193134

    In reply to: Widgets

    tyrsdei
    Participant

    https://pastebin.com/e2PaK55d

    This is how I’ve converted/copied it so far… Not exactly sure how I would add classes so I can tweak the output via css. I’m a PHP novice. And did I modify all the right fields? I looked at Creating a widget tutorials and modified what i think to be the appropriate code

    #193133

    In reply to: Widgets

    tyrsdei
    Participant

    https://bbpress.org/forums/topic/where-is-the-code-for-the-bbpress-widgets/ finally found answer here, for location.
    Best suggestion is probably to make my own plugin that adds the widget, right?

    #193132

    Topic: Widgets

    in forum Plugins
    tyrsdei
    Participant

    Hi, I’d like to make a custom widget with the default bbpress forum list widget as a code starting point. Where would I locate these, and where should I place them once I make it? Should i turn it into a personal plugin so i can use it on other sites if I wish?

    It’s just that the default one is meant for a side bar, and I want one for under my header on my main page.

    #193105
    MBV
    Participant

    How did you guys enable ajax for buddypress group forum?
    That link to https://cloudup.com/czqFBqJE8TE is expired so I can’t see the code that was edited. Are you able to add it again here?

    #193099
    EGF
    Participant

    I was able to resolve the issue by adding a conditional statement to check for bbpress search results using bbp_is_search_results(). The theme i’m using doesn’t play well with bbPress

    <?php if ( !bbp_is_search_results() ) : ?>	
        
       <?php endif;?>	
    EGF
    Participant

    When I perform a search, I get duplicate search results.

    One set of results have no sidebar (full page width) and immediately below that I get a duplicate set of search results with the sidebar widgets. I am using a bbpress.php file in my child theme. It appears to be using that.

    Here is my bbpress.php file:

    <?php
    /* Template Name: Page: bbpress.php */
    
    global $data;
    
    get_header(); ?>
    
    <div class="page-wrap">
    
    <?php get_template_part( 'framework/inc/slider' ); ?>
    <div id="page-body" class="page-body">
        
        <div class="container">
    				
    		<div id="page-title">
    		<hgroup>
    		   <h2>Fax Software</h2>
    		   <h1>Community Forums</h1>
                    </hgroup>
    		</div>
    			
    		<?php if ( function_exists('yoast_breadcrumb') ) 
                 {yoast_breadcrumb('<p id="breadcrumbs">','</p>');} ?>
    
    		<?php echo do_shortcode( '[bbp-search]' ) ?>  
    				
    		<div class="row">
    			<div class="span9"> 
    						
    			<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    					<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>><?php
    						the_content();
    						wp_link_pages(array('before' => 'Pages: ', 'next_or_number' => 'number')); ?>
    					</article><?php
    					if(!$data['check_disablecomments']) {
    						comments_template();
    					}
      				endwhile; endif; ?> 
    			</div>
     			<?php get_sidebar('forums'); ?>    
    			 
    		</div>
    	</div>
    	
    </div>
    <?php get_footer(); ?>

    I do not currently have a loop-search.php file in my child theme.

    #193062
    Anonymous User 13716511
    Inactive

    I have added a acf galley field to the user profile page using the acf plugin by setting it to show on the user profile page.
    The field is showing when I click ‘edit’ to edit the profile but the it isn’t working, when I try to add images they don’t show.
    Do I need to add custom code for it to work? What is the issue here?

    #193057
    ikhaismail
    Participant

    Hi @tazogamer. I tried your code to change user’s permalinks from nicename to ID’s. Yeah, the permalinks is changed, but the page its redirect is not found. Do you have any idea about this?

    keshabee
    Participant

    Is there a way to hide the the website field in bbpress for guest submissions or possib;y achieve this through code
    or possibly disable the website URl Filed area and hide it
    https://postimg.cc/image/68qfsj2vb/
    Thank you

    MWCreative
    Participant

    I’ve been digging around trying to find a way to move topics between forums and found a nice way to do it with php – I’ve posted the code and explanation here in case anyone is struggling:

    Bulk Move bbPress Topics PHP

    #193011
    MWCreative
    Participant

    Just in case anyone needs to alter the forum of topics manually with PHP:

    1. Find the Forum ID you’re moving topics to.
    2. Create a function to search for your required topics and set the ‘post_parent’ as the forum ID. (sample below)
    3. Set the topic’s post meta fields ‘bbp_topic_forum’, ‘_bbp_topic_forum’ and ‘_bbp_forum_id’ as the Forum ID.
    4. Repair the forums (tools->forums)

    After these steps you should see your topics in the correct forum!

    Place in functions.php file of your child theme and modify to your needs, then call the function:
    ** Disclaimer! I’m not responsible for breaking your site! backup your install before using this code to change your topics! **

    function mwc_change_forum_topic_ties() {
            
            // 18 was my target forum ID.  get yours.
    	$forumid = '18';
    	
    	$args = array(
    		'post_type' => 'topic',
    		'post_status' => 'publish',
    		'posts_per_page' => -1,
    	);
    
            /* uncomment this to filter your topics by something
    
            $oldForumID = '10'; //change this to target a specific forum
            $args['meta_query'] = array(
                    'meta_key' => 'bbp_topic_forum',
                    'meta_value' => $oldForumID,
                    'compare' => '='
            );
    
            */
    	
    	$query = new WP_Query( $args );
    	
    	if($query->have_posts()):
    		while($query->have_posts()):
    			$query->the_post();
    			$theid = get_the_ID();
    			
    			$theargs = array(
    				'ID' => $theid,
    				'post_parent' => $forumid
    			);
    			
    			wp_update_post($theargs);
    			
    			update_post_meta($theid, 'bbp_topic_forum', $forumid);
    			update_post_meta($theid, '_bbp_topic_forum', $forumid);
    			update_post_meta($theid, '_bbp_forum_id', $forumid);
    			update_post_meta($theid, '_bbp_topic_id', $theid);
    			
    		endwhile;	
    	endif;
    
    }
    #193002

    In reply to: GDPR Compliance

    Ari Stathopoulos
    Participant

    The only thing that I found has to go away 100% is IP-logging.
    It is no longer legal to display IPs publicly like bbPress currently does.

    On my site it was pretty simple to do using this:

    add_filter( 'bbp_current_author_ip', function() {
    	return '127.0.0.1';
    } );
    #192991
    agricolan
    Participant
    willallen83
    Participant

    Hi!

    I am trying to make any topics and replies submitted on the front end have a default category (I have extended the custom post type of bbPress to support categories). This works for everything submitted on the back end, but not everything submitted on the front end. I have played around with this a lot, and have not made any progress.

    I am using WordPress 4.9.5, bbPress 2.5.14 and the site I am working on (locked so this link probably won’t do any good) is https://gateway.aishasalem.com

        // adding possibilities to have categories for custom post types
        public function gt_custom_post_type_categories() {
          register_taxonomy_for_object_type( 'category', 'topic' );
          register_taxonomy_for_object_type( 'category', 'reply' );
        }
        add_action( 'init', 'gt_custom_post_type_categories', 11 );

    And this code to assign the categories as default when a post is saved / published. It works on the back end, but only partially on the front end.

        // setting default post catagory when saving
        public function gt_set_default_category( $post_id, $post, $update ) {
    
            // Slugs of the custom post types
            $slugs = array('topic', 'reply');
            // current post type
            $current_post_type = $post->post_type;
    
            // If this post isn't a custom posty type, don't update
            if ( !in_array($current_post_type, $slugs) ) {
              return;
            }
    
            // Sets the default category depending on the current post type
            switch ($current_post_type) {
              case 'topic':
                $default_category = 'livingroom-topics';
                break;
              case 'reply':
                $default_category = 'livingroom-replies';   // does not hook in on the fron end
                break;
              default:
                return;
            }
    
            // sets the default category
            $default_term = get_term_by('slug', $default_category, 'category');
            wp_set_object_terms(get_the_ID(), $default_term->term_id, 'category');
        }
        add_action( 'save_post', 'gt_set_default_category', 9, 3 );

    I have tried hooking into ‘bbp_new_reply’ but this doesn’t seem to help (maybe I am doing it wrong). Do you have any advice of how to do this? Where to hook into? If it should be a filter and a function of a different form (if so, please give as much info as possible, I am new to php wordpress and especially filters)?

    Thank you so much!!

    #192965
    scare31125
    Participant

    Hello,
    I have a bbPress site. I want to change some role permission.
    1. Participant Role will be able to delete their post and topic.
    2. Annonymous user can delete their post and reply.
    For number 1. I tried to follow this post but i am very confused. I added this code to theme child function.php

    add_filter ('bbp_get_topic_trash_link', 'topic_dont_delete');
    add_filter ('bbp_get_reply_trash_link', 'reply_dont_delete');
    
    function topic_dont_delete( $args = '') {
    
    		// Parse arguments against default values
    		$r = bbp_parse_args( $args, array(
    			'id'           => 0,
    			'link_before'  => '',
    			'link_after'   => '',
    			'sep'          => ' | ',
    			'trash_text'   => esc_html__( 'Trash',   'bbpress' ),
    			'restore_text' => esc_html__( 'Restore', 'bbpress' ),
    			'delete_text'  => esc_html__( 'Delete',  'bbpress' )
    		), 'get_topic_trash_link' );
    
    		$actions = array();
    		$topic   = bbp_get_topic( bbp_get_topic_id( (int) $r['id'] ) );
    
    		if ( empty( $topic ) || !current_user_can( 'delete_topic', $topic->ID ) ) {
    			return;
    		}
    
    		if ( bbp_is_topic_trash( $topic->ID ) ) {
    			$actions['untrash'] = '<a title="' . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_topic_trash', 'sub_action' => 'untrash', 'topic_id' => $topic->ID ) ), 'untrash-' . $topic->post_type . '_' . $topic->ID ) ) . '" class="bbp-topic-restore-link">' . $r['restore_text'] . '</a>';
    		} elseif ( EMPTY_TRASH_DAYS ) {
    			$actions['trash']   = '<a title="' . esc_attr__( 'Move this item to the Trash',      'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_topic_trash', 'sub_action' => 'trash',   'topic_id' => $topic->ID ) ), 'trash-'   . $topic->post_type . '_' . $topic->ID ) ) . '" class="bbp-topic-trash-link">'   . $r['trash_text']   . '</a>';
    		}
    		
    		if ( bbp_is_topic_trash( $topic->ID ) || !EMPTY_TRASH_DAYS ) {
    		if ( bbp_is_user_keymaster()) {
    		$actions['delete']  = '<a title="' . esc_attr__( 'Delete this item permanently',     'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_topic_trash', 'sub_action' => 'delete',  'topic_id' => $topic->ID ) ), 'delete-'  . $topic->post_type . '_' . $topic->ID ) ) . '" onclick="return confirm(\'' . esc_js( __( 'Are you sure you want to delete that permanently?', 'bbpress' ) ) . '\' );" class="bbp-topic-delete-link">' . $r['delete_text'] . '</a>';
    		}
    		}
    
    				// Process the admin links
    		$retval = $r['link_before'] . implode( $r['sep'], $actions ) . $r['link_after'];
    
    		return $retval ;
    	}
    	
    	function reply_dont_delete( $args = '' ) {
    
    		// Parse arguments against default values
    		$r = bbp_parse_args( $args, array(
    			'id'           => 0,
    			'link_before'  => '',
    			'link_after'   => '',
    			'sep'          => ' | ',
    			'trash_text'   => esc_html__( 'Trash',   'bbpress' ),
    			'restore_text' => esc_html__( 'Restore', 'bbpress' ),
    			'delete_text'  => esc_html__( 'Delete',  'bbpress' )
    		), 'get_reply_trash_link' );
    
    		$actions = array();
    		$reply   = bbp_get_reply( bbp_get_reply_id( (int) $r['id'] ) );
    
    		if ( empty( $reply ) || !current_user_can( 'delete_reply', $reply->ID ) ) {
    			return;
    		}
    
    		if ( bbp_is_reply_trash( $reply->ID ) ) {
    			$actions['untrash'] = '<a title="' . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_reply_trash', 'sub_action' => 'untrash', 'reply_id' => $reply->ID ) ), 'untrash-' . $reply->post_type . '_' . $reply->ID ) ) . '" class="bbp-reply-restore-link">' . $r['restore_text'] . '</a>';
    		} elseif ( EMPTY_TRASH_DAYS ) {
    			$actions['trash']   = '<a title="' . esc_attr__( 'Move this item to the Trash',      'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_reply_trash', 'sub_action' => 'trash',   'reply_id' => $reply->ID ) ), 'trash-'   . $reply->post_type . '_' . $reply->ID ) ) . '" class="bbp-reply-trash-link">'   . $r['trash_text']   . '</a>';
    		}
    
    		if ( bbp_is_reply_trash( $reply->ID ) || !EMPTY_TRASH_DAYS ) {
    		if ( bbp_is_user_keymaster()) {
    		$actions['delete']  = '<a title="' . esc_attr__( 'Delete this item permanently',     'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_reply_trash', 'sub_action' => 'delete',  'reply_id' => $reply->ID ) ), 'delete-'  . $reply->post_type . '_' . $reply->ID ) ) . '" onclick="return confirm(\'' . esc_js( __( 'Are you sure you want to delete that permanently?', 'bbpress' ) ) . '\' );" class="bbp-reply-delete-link">' . $r['delete_text'] . '</a>';
    		}
    		}
    
    		// Process the admin links
    		$retval = $r['link_before'] . implode( $r['sep'], $actions ) . $r['link_after'];
    
    		return $retval ;
    	}

    But as I understood that, it was trashing post not deleting them. What I have missed? This code didnot worked for me. May be I have missed some steps.

    And for 2, I don’t know if its possible or not. Searched a lot but haven’t found any solution yet. My understanding is annonymous is not a role, nore a user. So how we can achieve that?

    Thank You

    #192962
    caygri
    Participant

    Hello,

    I use Forum Migrator, but when i try to import user.
    Appear this error:

    Errore sul database di WordPress: [Unknown column 'users.msn' in 'field list']
    SELECT convert(users.uid USING "utf8mb4") AS uid,convert(users.password USING "utf8mb4") AS password,convert(users.salt USING "utf8mb4") AS salt,convert(users.username USING "utf8mb4") AS username,convert(users.email USING "utf8mb4") AS email,convert(users.website USING "utf8mb4") AS website,convert(users.regdate USING "utf8mb4") AS regdate,convert(users.usertitle USING "utf8mb4") AS usertitle,convert(users.aim USING "utf8mb4") AS aim,convert(users.yahoo USING "utf8mb4") AS yahoo,convert(users.icq USING "utf8mb4") AS icq,convert(users.msn USING "utf8mb4") AS msn,convert(users.signature USING "utf8mb4") AS signature FROM mybb_users AS users LIMIT 0, 100

    it’s just 130 user! Not big deal

    #192952
    crista007
    Participant

    The was wrong thing I forgot; for some reason I had issue with it causing a [shortcode] not to work, basically was masked in some way. Love to use jetpack feature but I need the other widget more right now which allows members to upload images.

    #192944
    Robin W
    Moderator

    This can be done, but requires you to be able to use FTP and edit a file

    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

    find
    wp-content/plugins/bbpress/templates/default/bbpress/content-statistics.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/content-statistics.php
    bbPress will now use this template instead of the original
    and you can amend this.

    so open the file and you will see starting at line 17

    <dt><?php _e( 'Registered Users', 'bbpress' ); ?></dt>
    	<dd>
    		<strong><?php echo esc_html( $stats['user_count'] ); ?></strong>
    	</dd>

    remove this and save the file back to wp-content/themes/%your-theme-name%/bbpress/content-statistics.php

    #192928
    dionadk
    Participant

    Robin, I installed the bbp-style-pack plugin. But there is not option to edit a single forum link. I saw options to change home link and forums link.

    I created a Single forum page with short code: [bbp-single-forum id=12]. I disabled the forums slug on the bread crumbs
    step 1: Home Page › Student Forum
    step 2: Home Page › Student Forum › Features of Site Wide Forum

    From here when I click on the student forum it redirects me to the student forum and not the page I created with the student forum short code in it.

    wordpress version: WordPress 4.9.5
    bbpress version: Version 2.5.14

    dionadk
    Participant

    I created a Single forum page with short code: [bbp-single-forum id=12]

    from the single forum page I navigate to one of the topics. when I click on the single forum page link it redirects me to the single forum but not to the page I created. I disabled the forums links in the bread crumbs. Is there a way to edit the link for the single forum so that I could point it the page I created.

    step 1: Home Page › Student Forum
    step 2: Home Page › Student Forum › Features of Site Wide Forum

    From here when I click on the student forum it redirects me to the student forum and not the page I created with the student forum short code in it.

    wordpress version: WordPress 4.9.5
    bbpress version: Version 2.5.14

    #192880
    cpmrgmt
    Participant

    Forum with padding problem and  grey line separator

    I have been trying to identify location and code to change in order to fix padding problem in the body of content/replies forum. Lack of padding makes the first letter of content to be hidden by arrowhead shape /line separating post message from author/date column.

    How could I totally eliminate such vertical grey line/border, and edit/change padding so post text does not appear attached to left?

Viewing 25 results - 4,276 through 4,300 (of 32,481 total)
Skip to toolbar