Forum Replies Created

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
  • in reply to: Fetch group cover inside loop? #91083
     parousia
    Participant

    Unfortunately its not working?

    my code is below

    COPY CODE
    
                            <?php
                            $user_id = bp_displayed_user_id();
                            $firstname = your_name_or_company_name(true);
                            $getusername = bp_get_displayed_user_username();
                            $args = array(
                                 'type' => 'alphabetical',
                                 'max' => 6,
                                 'user_id' => $user_id
                            );
    
                            if ( bp_has_groups ( $args )) { ?>
    
                                <div class="inner-right">
    
                                    <h3><?php echo $firstname; ?>'s <a href="http://www.cultexposure.com/members/<?php echo $getusername; ?>/groups/">groups</a></h3>
    
                                    <ul id="profile-group-list-wrap" class="my-groups-list item-list">
    
                                        <?php while ( bp_groups() ) : bp_the_group(); ?>
                                        <?php $image_url = groups_get_groupmeta( bp_get_group_id(), 'bpcp_group_cover' ); ?>
                                            <li class="profile-group-list" style="background-image:url("<?php echo $image_url; ?>")" >
                                                <div class="item-avatar">
                                                    <a href="<?php bp_group_permalink() ?>"><?php bp_group_avatar_thumb() ?></a>
                                                </div>
    
                                                <div class="item">
                                                    <div class="item-title"><a href="<?php bp_group_permalink() ?>" title="<?php bp_group_name() ?>"><?php bp_group_name() ?></a></div>
                                                    <div class="item-meta"><span class="activity"><?php bp_group_member_count() ?></span></div>
                                                </div>
                                            </li>
    
                                        <?php endwhile; ?>
                                    </ul>
    
                                    <div class="homepage-btn">
                                        <a href="http://www.cultexposure.com/members/<?php echo $getusername; ?>/groups/"><span></span>Browse your groups</a>
                                    </div>
    
                                </div>
                            <?php } ?>    
    
    in reply to: adding elements to masonry blog layout. #84098
     parousia
    Participant

    Hi,

    Just to follow up on this post. I couldn’t quite get it to work as I wanted too. Due to the way VC works Its impossible to have the masonry layout flow around elements in another column also you cant continue the posts loop in another element after you’ve broken it up in a row. It might be possible if you could query posts to display within specific dates but I couldn’t find this option.

    So I decided to add featured sections directly inside the posts loop in index.php using the code below :

    COPY CODE
    
    	// Start the Loop.
    	while ( have_posts() ) : the_post();
             $count++;
            if ($count == 2) { 
            
    		if ( $blog_type != 'standard' ) :
            get_template_part( 'page-parts/post-content-' . $blog_type );
    		else:  
                get_template_part( 'content', get_post_format() );
    		endif;
                
                ?>
                <div class="blog-sticky-post-wrapper">
                    <div class="blog-sticky-post">
                        <h3>Latest <span class="title-key-color">Photographs</span></h3>
                        <?php echo do_shortcode("[rtmedia_gallery global=\"true\" per_page=\"8\" media_title=\"false\"]"); ?>
                        <div class="homepage-btn">
                            <a href="http://www.cultexposure.com/photographs/"><span></span>More photographs</a>                        
                        </div>
                    </div>
                </div>
                
                <?php
                              
    
                             } else {
    		/*
    		 * Include the post format-specific template for the content. If you want to
    		 * use this in a child theme, then include a file called called content-___.php
    		 * (where ___ is the post format) and that will be used instead.
    		 */
    		?>
    		<?php 
    		if ( $blog_type != 'standard' ) :
                get_template_part( 'page-parts/post-content-' . $blog_type );
    		else:  
                get_template_part( 'content', get_post_format() );
    		endif;
            }
            wp_reset_postdata(); 
    	endwhile;
    
    in reply to: Help with second blog template #84097
     parousia
    Participant

    Hi,

    I managed to solve this problem, it seems I needed to load the post templates in the if statement first before I added my own content as below.

    COPY CODE
    
    	while ( $query->have_posts() ) : $query->the_post();
             $count++;
            if ($count == 2) { 
            
    		if ( $blog_type != 'standard' ) :
            get_template_part( 'page-parts/post-content-' . $blog_type );
    		else:  
                get_template_part( 'content', get_post_format() );
    		endif;
                
                ?>
                <div class="blog-sticky-post-wrapper">
                    <div class="blog-sticky-post">
                        <h3>Latest <span class="title-key-color">Photographs</span></h3>
                        <?php echo do_shortcode("[rtmedia_gallery global=\"true\" per_page=\"8\" media_title=\"false\"]"); ?>
                        <div class="homepage-btn">
                            <a href="http://www.cultexposure.com/photographs/"><span></span>More photographs</a>                        
                        </div>
                    </div>
                </div>
                
                <?php
                              
    
                             } else {
    		/*
    		 * Include the post format-specific template for the content. If you want to
    		 * use this in a child theme, then include a file called called content-___.php
    		 * (where ___ is the post format) and that will be used instead.
    		 */
    		?>
    		<?php 
    		if ( $blog_type != 'standard' ) :
                get_template_part( 'page-parts/post-content-' . $blog_type );
    		else:  
                get_template_part( 'content', get_post_format() );
    		endif;
            }
            wp_reset_postdata(); 
    	endwhile;
    
    in reply to: meta key for avatar #82978
     parousia
    Participant

    Thanks good advice!

    If anyone wants to know how its done the code is below:

    COPY CODE
    
    function my_cache_avatar_url() {
    	update_user_meta( bp_displayed_user_id(), 'modemloopers_awesome_avatar_url', bp_core_fetch_avatar( 'html=false&item_id=' . bp_displayed_user_id() ) );
    }
    add_action( 'xprofile_screen_change_avatar', 'my_cache_avatar_url' );
    
    in reply to: moving #item-nav #74145
     parousia
    Participant

    I’m not much good at php I sort of just worked it out as I went along so there might be a better way of doing this, also I strongly advise you use the child theme if you’re not already.

    Buddypress.php can be found in the wp-content/themes/kleo directory. On line 105 of the buddypress.php file you should see an if statement that looks like this:

    COPY CODE
    
    <?php if( sq_option( 'bp_full_profile', 0 ) == 1 && bp_is_user() ): ?>
    
        <section class="alternate-color bp-full-width-profile">
            <div id="item-header" role="complementary">
    
                <?php bp_get_template_part('members/single/member-header') ?>
    
            </div>
            <!-- #item-header -->
                    
        </section>
    
    <?php endif; ?>
    
    

    I then added to the if statement so it look like this :

    COPY CODE
    
    <?php if( sq_option( 'bp_full_profile', 0 ) == 1 && bp_is_user() ): ?>
    
        <section class="alternate-color bp-full-width-profile">
            <div id="item-header" role="complementary">
    
                <?php bp_get_template_part('members/single/member-header') ?>
    
            </div>
            <!-- #item-header -->
            
            <div id="main-container" class="container">
                <div class="row">
                    <div id="buddy-menu-top" class="main-color">
                        <div id="buddypress">
    
                          <div class="row">
    
                                    <div class="col-sm-12">
                                <div id="item-nav">
                                      <div class="item-list-tabs no-ajax" id="object-nav" role="navigation">
                                          <ul class="responsive-tabs">
                                              <?php bp_get_displayed_user_nav(); ?>
    
                                              <?php do_action('bp_member_options_nav'); ?>
    
                                          </ul>
                                      </div>
                                  </div>
                                  <!-- #item-nav -->
                              </div>
    
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
        </section>
    
    <?php endif; ?>
    

    So you dont get two menus showing up you also have to remove the following code from the home.php which can be found in themes/kleo/buddypress/members/single

    COPY CODE
    
            <div id="item-nav">
                  <div class="item-list-tabs no-ajax" id="object-nav" role="navigation">
                      <ul class="responsive-tabs">
                          <?php bp_get_displayed_user_nav(); ?>
     
                          <?php do_action('bp_member_options_nav'); ?>
     
                      </ul>
                  </div>
              </div>
              <!-- #item-nav -->
    

    I also noticed that the menu still shows up in the media tab to get I used css display:none on the div although its probably better and more efficient to find it and remove it from the file.

    Hope that helps.

    in reply to: moving #item-nav #74054
     parousia
    Participant

    Figured it out my solution if anyone is interested was to put the buddypress .php file and edited the following code:

    COPY CODE
    
    <?php if( sq_option( 'bp_full_profile', 0 ) == 1 && bp_is_user() ): ?>
    
        <section class="alternate-color bp-full-width-profile">
            <div id="item-header" role="complementary">
    
                <?php bp_get_template_part('members/single/member-header') ?>
    
            </div>
            <!-- #item-header -->
            
            <div id="main-container" class="container">
                <div class="row">
                    <div id="buddy-menu-top" class="main-color">
                        <div id="buddypress">
    
                          <div class="row">
    
                                    <div class="col-sm-12">
                                <div id="item-nav">
                                      <div class="item-list-tabs no-ajax" id="object-nav" role="navigation">
                                          <ul class="responsive-tabs">
                                              <?php bp_get_displayed_user_nav(); ?>
    
                                              <?php do_action('bp_member_options_nav'); ?>
    
                                          </ul>
                                      </div>
                                  </div>
                                  <!-- #item-nav -->
                              </div>
    
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
        </section>
    
    <?php endif; ?>
    

    I made the html as similar to the original menu as possible in order to keep the css applied.

    a very rough example can be seen here – http://www.cultexposure.com/members/lauriedugdale/

    in reply to: in text link to profile pages and tabs? #48216
     parousia
    Participant

    Thanks a lot for your time and help it all sorted now.

    regarding the buddylinks plugin incase anyone is interested their instructions have a typo instead of bmlink in the shortcode it is bllink e.g.

    COPY CODE
    
    [buddylink bllink="activity" bltext="your activity page"]
    not
    [buddylink bmlink="activity" bltext="your activity page"]
    in reply to: transparent main menu on buddypress pages #47073
     parousia
    Participant

    Hi,

    Thanks for the reply I’ve managed to figure it out. I have one other problem though.

    Ive changed the Icon files and I’ve been adding in new icons using css. However I’m stuck on 2 navbar icons I cant seem to change them?

    The css I’m using is:

    COPY CODE
    .icon-mail-2:after{ content: "\E82C";}
    .icon-search:after{ content: "\E82D";}

    Any help would be greatly appreciated!

    in reply to: Redirect when adding a profile field #45015
     parousia
    Participant

    Hi I’ve followed the steps but its still displaying “array” for the speciality field (which is a multi select box). Theyre also both now on the same line as each other. How do I display them on different lines? Thanks for your help.

    COPY CODE
    
    		<?php
    
    			add_action( 'bp_profile_header_meta', 'display_user_role' );
    			function display_user_role() {
    				echo '';
    				$args = array(
    					'field'   => 'role', // Field name or ID.
    					 );
    				bp_profile_field_data( $args );
    			} 
    			
    			add_action( 'bp_profile_header_meta', 'display_user_speciality' );
    			function display_user_speciality() {
    				echo '';
    				$args = array(
    					'field'   => 'speciality', // Field name or ID.
    					 );
    				bp_profile_field_data( $args );
    			} 			
    			
    		 do_action( 'bp_profile_header_meta' );
     
    		 ?>
    
    in reply to: Redirect when adding a profile field #44998
     parousia
    Participant

    Hi Thanks for the quick reply.

    The issue seems to have resolved itself? Maybe a cookie problem?

    I also have one other issue which I was going to start a thread for but in the member header I’ve added this code before the close of item meta:

    COPY CODE
            <div id="member_profile">
            	<div class="profile_fields"><span><?php bp_profile_field_data( 'field=Role' );do_action( 'bp_before_member_header_meta' );?></span></div>
                <div class="profile_fields"><span><?php bp_profile_field_data( 'field=Speciality' );do_action( 'bp_before_member_header_meta' );?></span></div>         
            </div>

    However its displaying the speciality field as an “array”? How do i get it to display as text?

    see the link as an example http://cultexposure.com/members/lauriedugdale/profile/

    Thanks again for your help

Viewing 10 posts - 1 through 10 (of 10 total)

Log in with your credentials

Forgot your details?