Skip to:
Content
Pages
Categories
Search
Top
Bottom

(CSS Review Needed) Switching poster picture and link to UserPro

  • @alekbounce

    Participant

    Hi everyone!

    I’m using a members plugin called UserPro. I’m trying to integrate bbPress forums with the user profiles created through UserPro.

    All I’m trying to do is replace the user’s photo and username links to instead link to the UserPro profiles.

    Here’s a visual.

    The plugin’s developer gave users his own CSS changes to the “Loop-single-topic”, “Loop-single-reply” and the “loop-single-forum” .php files.

    Though his supplied CSS works in terms of replacing the links, it also breaks the look of the entire forum and removes all of the info below the user’s pic and name.

    Here’s the default “loop-Single-reply”:

    <?php
    
    /**
     * Replies Loop - Single Reply
     *
     * @package bbPress
     * @subpackage Theme
     */
    
    ?>
    
    <div <?php bbp_reply_class(); ?>>
    
    	<div class="bbp-reply-author">
    
    		<?php do_action( 'bbp_theme_before_reply_author_details' ); ?>
    
    		<?php bbp_reply_author_link( array( 'sep' => '', 'show_role' => true ) ); ?>
    
    		<div class="bbp-reply-post-date"><?php bbp_reply_post_date(); ?></div>
    
    		<div class="bbps-post-count"><?php printf( __( 'Post count: %s', 'Avada' ), bbp_get_user_reply_count_raw(bbp_get_reply_author_id()) ); ?></div>
    
    		<?php if ( bbp_is_user_keymaster() ) : ?>
    
    			<?php do_action( 'bbp_theme_before_reply_author_admin_details' ); ?>
    
    			<div class="bbp-reply-ip"><?php bbp_author_ip( bbp_get_reply_id() ); ?></div>
    
    			<?php do_action( 'bbp_theme_after_reply_author_admin_details' ); ?>
    
    		<?php endif; ?>
    
    		<?php do_action( 'bbp_theme_after_reply_author_details' ); ?>
    
    	</div><!-- .bbp-reply-author -->
    
    	<div class="bbp-reply-content">
    
    		<div id="post-<?php bbp_reply_id(); ?>" class="bbp-reply-header clearfix">
    
    			<div class="bbp-meta">
    
    				<?php if ( bbp_is_single_user_replies() ) : ?>
    
    					<span class="bbp-header">
    						<?php _e( 'in reply to: ', 'bbpress' ); ?>
    						<a class="bbp-topic-permalink" href="<?php bbp_topic_permalink( bbp_get_reply_topic_id() ); ?>"><?php bbp_topic_title( bbp_get_reply_topic_id() ); ?></a>
    					</span>
    
    				<?php endif; ?>
    
    				<a href="<?php bbp_reply_url(); ?>" class="bbp-reply-permalink">#<?php bbp_reply_id(); ?></a>
    
    				<?php do_action( 'bbp_theme_before_reply_admin_links' ); ?>
    
    				<?php bbp_reply_admin_links( array ( 'after' => '<span class="admin_links_sep"> | </span></span>') ); ?>
    
    				<?php do_action( 'bbp_theme_after_reply_admin_links' ); ?>
    
    			</div><!-- .bbp-meta -->
    
    		</div><!-- #post-<?php bbp_reply_id(); ?> -->
    
    		<div class="bbp-reply-entry">
    			<?php do_action( 'bbp_theme_before_reply_content' ); ?>
    
    			<?php bbp_reply_content(); ?>
    
    			<?php do_action( 'bbp_theme_after_reply_content' ); ?>
    			<div class="bbp-arrow"></div>
    		</div>
    
    	</div><!-- .bbp-reply-content -->
    
    </div><!-- .reply -->
    

    Here’s his supplied CSS:

    <?php
    
    /**
     * Replies Loop - Single Reply
     *
     * @package bbPress
     * @subpackage Theme
     */
    
    ?>
    
    <div <?php bbp_reply_class(); ?>>
    
    	<div class="bbp-reply-author">
    
    		<?php do_action( 'bbp_theme_before_reply_author_details' ); ?>
    
    		<?php 
    
    /* Integrating UserPro */
    		global $userpro;
    		$link = preg_replace("/(?<=href=(\"|'))[^\"']+(?=(\"|'))/", $userpro->permalink( bbp_get_reply_author_id() ), 
    		bbp_get_reply_author_link( array( 'sep' => '<br />', 'show_role' => false ) ) );
    		echo $link . userpro_show_badges( bbp_get_reply_author_id() );
    		?>
    
    		<?php if ( bbp_is_user_keymaster() ) : ?>
    
    			<?php do_action( 'bbp_theme_before_reply_author_admin_details' ); ?>
    
    			<div class="bbp-reply-ip"><?php bbp_author_ip( bbp_get_reply_id() ); ?></div>
    
    			<?php do_action( 'bbp_theme_after_reply_author_admin_details' ); ?>
    
    		<?php endif; ?>
    
    		<?php do_action( 'bbp_theme_after_reply_author_details' ); ?>
    
    	</div><!-- .bbp-reply-author -->
    
    	<div class="bbp-reply-content">
    
    		<?php do_action( 'bbp_theme_before_reply_content' ); ?>
    
    		<?php bbp_reply_content(); ?>
    
    		<?php do_action( 'bbp_theme_after_reply_content' ); ?>
    
    	</div><!-- .bbp-reply-content -->
    
    </div><!-- .reply -->
    

    I would be grateful to get any assistance on how I might change the links alone without modifying or breaking everything else. Thanks so much in advance.

    I’m using the Avada theme.

Viewing 3 replies - 1 through 3 (of 3 total)
  • @robkk

    Moderator

    this is not CSS its mostly PHP

    from what it looks like just copy the templates the userpro plugin author gave you and place it a folder called bbpress in your child theme. the url to it should be wp-content/themes/avada-child/bbpress.

    info on creating a child theme

    https://codex.wordpress.org/Child_Themes

    @robkk

    Moderator

    thats not CSS at all …most of its PHP

    it seems like you just put the PHP files that the userpro plugin author gave you and put it into a directory named bbpress in a child theme and it should work fine from there.

    so the url to the directory should be wp-content/themes/avada-child/bbpress

    if you havent created a child theme , here hows to

    https://codex.wordpress.org/Child_Themes

    more about bbPress theme compatibility

    https://codex.bbpress.org/theme-compatibility/

    @robkk

    Moderator

    this is not CSS its mostly PHP

    from what it looks like just copy the templates the userpro plugin author gave you and place it a folder called bbpress in your child theme. the url to it should be wp-content/themes/avada-child/bbpress.

    more info about bbpress theme compatibility

    https://codex.bbpress.org/theme-compatibility/

    info on creating a child theme

    https://codex.wordpress.org/Child_Themes

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar