Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 12 replies - 551 through 562 (of 562 total)
  • @anonymized-6594935

    Inactive

    sorry i misunderstood, i’m not english, i thought banner == header…

    This is an example for the activity/index.php template : the hook just under the activity page title is :
    `bp_before_directory_activity_content`

    so in the functions.php of your active theme, you can add something like this :

    `add_action(‘bp_before_directory_activity_content’, ‘i_do_not_want_custom_header’);

    function i_do_not_want_custom_header(){
    ?>

    <?php
    }`

    I’m sure you’ll find the right hooks to add your ‘narrow photo’ in the other BuddyPress templates..

    @anonymized-6594935

    Inactive

    Hello @valuser

    Yes it can be done for tags. The trouble with your snippet is that you’re calling a function that doesn’t exist in WordPress : get_the_post_tag() !! So i adapted your function using this one https://codex.wordpress.org/Function_Reference/get_the_tags and instead of tag ids i think it’s more convenient to use tag slugs :

    function do_not_record_this_tag( $post_id, $post ){
    
    /* this is the array that contains the category to exclude */
    $tag_slugs_to_exclude = array( 'exclude' );
    
    if ( 'publish' != $post->post_status )
    return false;
    
    $post_tags = get_the_tags( $post_id );
    $in = false;
    
    if( !empty( $post_tags ) ) {
    
    foreach ( $post_tags as $post_tag ) {
    if( in_array( $post_tag->slug, $tag_slugs_to_exclude ) )
    $in = true;
    
    }
    
    /* if the post has at least one excluded tag, then we remove the BuddyPress hook that records an activity */
    if( $in )
    remove_action( 'save_post', 'bp_blogs_record_post', 10, 2 );
    
    }
    
    }
    
    add_action( 'save_post', 'do_not_record_this_tag', 9, 2 );

    if you prefer id then replace the tag slugs by ids in the array $tag_slugs_to_exclude and replace $post_tag->slug by $post_tag->term_id

    @anonymized-6594935

    Inactive

    you’re welcome :)

    @anonymized-6594935

    Inactive

    hello, just made this test with the inspector browser :

    #header{
    /* i unchecked this css property */
    overflow: hidden;
    }

    then your dropdown shows..

    @anonymized-6594935

    Inactive

    Hello @tgoedde

    If you’re using the theme BP Default, it’s quite easy actually. As this theme supports custom-header, you can simply edit the BuddyPress pages (Activity, register, groups, forum… and so on) in which you want to add a custom header.

    I just tested this in my activity page.
    1/ Edit the page in WordPress backend
    2/ Use the media button to select your photo, it must have at least a width of 1250px (if under, the pic won’t show)
    3/ Upload and choose not to insert but to use as featured image. Once done you can close the thick box window.
    4/ you’ll see in the edit page / the featured image box at the bottom right with your uploaded image shrinked.
    5/ Save the page. And you’re done ;)

    Repeat these steps for each BuddyPress template you want to add a custom header to.

    @anonymized-6594935

    Inactive

    @creaturis you’re welcome & thanks :)

    @anonymized-6594935

    Inactive

    Ok.

    the id’s are to paste in this array $ids_to_exclude = array( 4, 1, 2... );

    do not touch this code :
    add_action( 'save_post', 'do_not_record_this_category', 9, 2 );

    9 means we’ll fire this hook with the priority of 9 as bp_blogs_record_post fires a bit later at priority 10. The 2 means how many vars we want to get from the hook ‘save_post’.

    @anonymized-6594935

    Inactive

    Hello,

    I don’t use the plugins you’re mentioning but in your situation, i think i’ll try to add this code in the functions.php file of my active theme :

    function luke_get_the_topic_post_poster_id() {
    global $topic_template;
    
    return $topic_template->post->poster_id;
    }

    And then i would replace in your topic.php
    post->poster_id); ?>
    by

    and
    post->poster_id); ?>
    by

    I’ve tested to just echo the luke_get_the_topic_post_poster_id() in my topic.php and it seems to work. I think the trouble in your code is that you don’t reference global $topic_template.

    @anonymized-6594935

    Inactive

    Hi @creaturis,

    I think the best solution is to avoid recording an activity if the post has one of the category you want to exclude from activity stream, in the functions.php file of your active theme, you can try this code :

    function do_not_record_this_category( $post_id, $post ){
    
    /* this is the array that contains the category to exclude */
    $ids_to_exclude = array( 4 );
    
    if ( 'publish' != $post->post_status )
    return false;
    
    $categories = get_the_category( $post_id );
    $in = false;
    
    if( count($categories) > 0 ) {
    
    foreach ( $categories as $category ) {
    
    if( in_array( $category->cat_ID, $ids_to_exclude) )
    $in = true;
    
    }
    
    /* if the post has at least one excluded category, then we remove the BuddyPress hook that records an activity */
    if( $in )
    remove_action( 'save_post', 'bp_blogs_record_post', 10, 2 );
    
    }
    
    }
    
    add_action( 'save_post', 'do_not_record_this_category', 9, 2 );

    In 1.6 you can set the visibility of profile fields to logged in users, friends or anyone. I haven’t seen the behavior you’re describing.

    @anonymized-6594935

    Inactive

    Hello @chouf1,

    you can fix it by css :

    #toto span{
    float:left;
    margin:5px;
    }

    But at line 4 of your code don’t forget to close the li tag
    ..."_blank">Users</a> </LI>';

    @anonymized-6594935

    Inactive

    It means you’re using BP My Home plugin.

    You only have to go to WordPress Backend / BuddyPress Menu / BPMH Manger submenu to display the list of available widgets. Then activate the ones you want to make available to users.

    @anonymized-6594935

    Inactive

    @DJPaul Thanks a lot for your quick reply !! Happy it’s fixed thks to @andrewteg :)

Viewing 12 replies - 551 through 562 (of 562 total)
Skip to toolbar