Forum Replies Created
-
Author
-
February 27, 2017 at 01:18 in reply to: Custom post author’s archive URL discrepancy in Kleo #154220HappiierParticipant
Can you please let the forum know of the change you needed to make this code work? Thank you
HappiierParticipantYes, please definitely allow K-Elements and Masonry View for archives and other posts. Kleo has it all, BuddyApp has potential but feels a little skimpy in some areas now that I have purchased it. A few more bells and whistles and you will have a second perfect theme (and these are all things that you have already developed for Kleo).
HappiierParticipantPLEASE SKIP AHEAD TO THIS REPLY!!!!!!!!!!!!!!!!!!!!!!!!
I am super close and now only need simple advice. I used the following code and I am just about able to complete the process (SEE PHOTO). However, I need some help to get things in order.
I am pretty sure that I need to make new template parts, but I need some clarity if this is correct. Thank you so much!!
———————————————————————————-
Note: “bpawesome” = copy of Archive.php that I can modify.
//POSTS ON PROFILE STARTS HERE
add_action( ‘bp_setup_nav’, ‘add_profileposts_tab’, 100 );
function add_profileposts_tab() {
global $bp;
bp_core_new_nav_item( array(
‘name’ => ‘My Posts’,
‘slug’ => ‘posts’,
‘screen_function’ => ‘bp_postsonprofile’,
‘default_subnav_slug’ => ‘My Posts’,
‘position’ => 25
)
);
}
// show feedback when ‘Posts’ tab is clicked
function bp_postsonprofile() {
add_action( ‘bp_template_content’, ‘profile_screen_posts_show’ );
bp_core_load_template( apply_filters( ‘bp_core_template_plugin’, ‘members/single/plugins’ ) );
}function profile_screen_posts_show() {
query_posts( ‘author=’ . bp_displayed_user_id() );
if ( have_posts() ) :
get_template_part( ‘bpawesome’ );
else:?><p><?php bp_displayed_user_username(); ?> has not published any post! </p><?php endif; ?> <?php
}
//POSTS ON PROFILE ENDS HERE
Attachments:
You must be logged in to view attached files.HappiierParticipantActually, projectwyld.com/author/authorname is exactly what I need to show.
It has the appropriate Kleo Masonry in the correct columns. I just need for the main content area/post area to be called without the sidebar, footer, and socket as when I plug in archive.php in the code provided.
Hope this helps.
HappiierParticipantThank you for your response. I found this code snippet which seems to be great! However, I am having an issue identifying which template part would work to display KLEO MASONRY posts for a given author. (see images)
Can you please identify which .php file I should be calling or what to include in a new.php template.
I have tried many existing as you can see in the images. None were exactly correct.
With Gratitutde,
BlazeCODE:
// Display posts in user profile
// Construct new user profile tab
add_action( ‘bp_setup_nav’, ‘add_profileposts_tab’, 100 );
function add_profileposts_tab() {
global $bp;
bp_core_new_nav_item( array(
‘name’ => ‘My Posts’,
‘slug’ => ‘posts’,
‘screen_function’ => ‘bp_postsonprofile’,
‘default_subnav_slug’ => ‘My Posts’,
‘position’ => 35
)
);
}// show ‘Posts’ tab once clicked
function bp_postsonprofile() {
add_action( ‘bp_template_content’, ‘profile_screen_posts_show’ );
bp_core_load_template( apply_filters( ‘bp_core_template_plugin’, ‘members/single/plugins’ ) );
}// query the loop and get the template
function profile_screen_posts_show() {
$user_id = bp_displayed_user_id();
$query = new WP_Query( ‘author=’ . $user_id );if ( $query->have_posts() ) :
while ( $query->have_posts() ): $query->the_post();
// fill in your template part here, if you have another template than member-posts.php
get_template_part( ‘member-posts’ );
endwhile;else: ?>
// if the author hasn’t made any posts, display this message
<p><?php bp_displayed_user_username(); ?>’s hasn’t made any posts yet! </p><?php endif; wp_reset_postdata();?> <?php
}
Attachments:
You must be logged in to view attached files.HappiierParticipantI’m sorry, disregard this post as it should have been included in previous ticket.
HappiierParticipantAnd here is the code:
// Display posts in user profile
// Construct new user profile tab
add_action( ‘bp_setup_nav’, ‘add_profileposts_tab’, 100 );
function add_profileposts_tab() {
global $bp;
bp_core_new_nav_item( array(
‘name’ => ‘Awesome’,
‘slug’ => ‘awesome’,
‘screen_function’ => ‘bp_postsonprofile’,
‘default_subnav_slug’ => ‘My Posts’,
‘position’ => 10
)
);
}// show ‘Posts’ tab once clicked
function bp_postsonprofile() {
add_action( ‘bp_template_content’, ‘profile_screen_posts_show’ );
bp_core_load_template( apply_filters( ‘bp_core_template_plugin’, ‘members/single/plugins’ ) );
}// query the loop and get the template
function profile_screen_posts_show() {
$user_id = bp_displayed_user_id();
$query = new WP_Query( ‘author=’ . $user_id );if ( $query->have_posts() ) :
while ( $query->have_posts() ): $query->the_post();
// fill in your template part here, if you have another template than member-posts.php
get_template_part( ‘post-content-masonry’ );
endwhile;else: ?>
// if the author hasn’t made any posts, display this message
<p><?php bp_displayed_user_username(); ?>’s hasn’t made any posts yet! </p><?php endif; wp_reset_postdata();?> <?php
}
HappiierParticipantHello Radu and Team,
Problem: I have this issue with multisite using multi network buddypress (buddydev). Everything works great except avatar doesn’t link to root blog, therefore the avatar doesn’t translate to all subdomains.
Solution: The code below is a solution BUT when I add a bp_custom.php in the plugins folder with the code below nothing happens. I tested this code by adding it to the buddypress functions root and it works great- but it breaks other components.
Question: Where can I put this code so it is recognized and works accordingly?
With Gratitude,
BlazeSOLUTION FROM BUDDYDEV:
/**
* To solve avatar issues
*/
function bpdev_fix_avatar_dir_path( $path ){
if ( is_multisite() && BP_ENABLE_MULTIBLOG )
$path = ABSPATH . ‘wp-content/uploads/’;
return $path;
}
add_filter( ‘bp_core_avatar_upload_path’, ‘bpdev_fix_avatar_dir_path’, 1 );
//fix the upload dir url
function bpdev_fix_avatar_dir_url( $url ){
if ( is_multisite() )
$url = network_home_url(‘/wp-content/uploads’) ;
return $url;
}
add_filter( ‘bp_core_avatar_url’, ‘bpdev_fix_avatar_dir_url’, 1 );
}HappiierParticipantHi Radu and Team,
I have successfully added custom group types in this way (ie, group 1 group 2 and group 3 all belong to group type “Adventure”). However, I do not understand how to make these show up in the Group Masonry filter options so that only group type “Adventure” is populated in a specific area. Can you please provide a way to select a group type to show in kleo group masonry?
With Gratitude,
BlazeFrom Buddypress.org (LINK: https://codex.buddypress.org/developer/group-types/)
“Querying by group type
A common task is to retrieve a list of groups of a given type (or set of types). bp_has_groups() and BP_Groups_Group::get() accept a ‘group_type’ parameter, which can be a single group type or an array/comma-separated list of group types. This will filter query results to those groups matching the type. Example:
// Fetch all teams and companies.
$group_args = array(
‘group_type’ => array( ‘team’, ‘company’ ),
);
if ( bp_has_groups( $group_args ) ) { // …”HappiierParticipantThanks Laura!
I’ve spent hours upon hours here this week and I have to say that you guys are amazing!!! It takes some time and dedication, but I have been able to find almost everything I’ve needed to completely customize my site (and I’m brand new to this).
There are a bunch of outdated posts that can get people into trouble, though. It would be great to have a button to indicate that 🙂
With Gratitude,
BlazeHappiierParticipantI need to throw one more request your way. Can you please help me to select the color of the active tab in Kleo Tabs AND/OR eliminate the gap to 0px so I can achieve the desired color with a row background (see image).
Again, thank you so much for your efforts on the three styling requests in this ticket.
Attachments:
You must be logged in to view attached files.HappiierParticipantOne additional request, sorry for the delay… Can you also help me to remove the grey border in the “Kleo Tabs – Line” as is pictured. Thanks again!!
Attachments:
You must be logged in to view attached files.HappiierParticipantHi Radu,
After much deliberation we have decided to err on the side of simplicity and save you some time 🙂 We no longer need to drop the title and meta beneath the featured content.Thank you for your attention and all the support you offer!
Tal Blaze
HappiierParticipantThank you for the update! Including the attached file into the child theme DOES move the meta after FEATURED IMAGES, however it DOES NOT work for FEATURED VIDEO POSTS.
Can you please provide me with a modification that will work on both Featured Images and Featured Videos.
With Gratitude,
Tal BlazeHappiierParticipantHi Radu,
I just tried to add the content.php file into the kleo child theme but the post meta is still showing above featured media in single post. Can you please offer your assistance?
Thank you,
BlazeHappiierParticipantChiming in!
I would love to know how to change the Share This “Like” heart-icon to (1) admin image and (2) a different icon from kleo library – not sure which I prefer to use yet.
Please also offer css for
1. Size of Icon
2. Size of Text after icon
3. Color
4. Hover Color
5. Background/boarder css if this is a button!Thank you for your hard work 🙂
With Gratitude,
BlazeHappiierParticipantThis is the exact format that I want to duplicate: http://adventure.com/
Simple fixed sidebar that I can adjust css and scrollable right content.
Thank you for the help!
Blaze
HappiierParticipantThank you for the information. It helped with some of the requests.
Pending:
1. Left title marker color by post type
2. Fixed sidebar layout
– The link to another help topic was ok but did not really accomplish what I need. A fixed sidebar left with full scrollable website content right. (see attached)
– I would love for it to function like the acctual zurb website with fixed left sidebar or the blog example given in the template: http://zurb.com/building-blocks/sidebar-blog-template
– I implemented the css provided for the template and it almost worked, but scrollable content did not seem to relate properly to new sidebar AND problems at browser sizes between Desktop Large and Mobile layout.Please advise what I can do to resolve. Thank you very much.
With Gratitude,
BlazeAttachments:
You must be logged in to view attached files.HappiierParticipantHi Radu!
Sorry about that. It must not have uploaded properly. I love Kleo more than any theme I have used and I have three main requests to perfect it for my purposes. Please see image attachment for each.
I am hoping you can address each in this one place, however I understand if I must open three separate tickets. Please advise and thank you so much for your help with this 🙂
With Gratitude,
BlazeAttachments:
You must be logged in to view attached files.HappiierParticipantKieran,
Thank you for the super quick response!! It worked perfectly 🙂You’re the best.
Blaze -
AuthorPosts