Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 1 through 25 (of 109 total)

  • enderpal444
    Participant

    @enderpal444


    enderpal444
    Participant

    @enderpal444

    Colbert Bump =)


    enderpal444
    Participant

    @enderpal444

    Also Im using parameters from the posts 2 posts plugin and meta_key for others which the codex doesn’t seem to allow for bp_has_members()


    enderpal444
    Participant

    @enderpal444

    @djpaul Ok because I just thought I was reading about how it was built to scale and I’m dealing with alot of users and large lists.


    enderpal444
    Participant

    @enderpal444

    @modemlooper Really appreciate the explanation! I got it working with infinite scroll on a user ‘s front page to show their posts which is a nice extension. Thanks alot!


    enderpal444
    Participant

    @enderpal444

    @modemlooper Do you see any flaw in my code givin that I’m using xprofile_screen_display_profile? This method worked perfectly when creating loops under say mysite.com/exampleuser/articles/ but its isn’t paging for the top level. It just takes me to a blank members screen. hmmm


    enderpal444
    Participant

    @enderpal444

    kabump


    enderpal444
    Participant

    @enderpal444

    still lost on this


    enderpal444
    Participant

    @enderpal444

    Ohhh. I didn’t know I was actually creating a component just by adding a new nav. Thx @modemlooper!


    enderpal444
    Participant

    @enderpal444

    @djpaul @boonebgorges Could you give this a quick look. I tried adding theme root and theme root uri but now it doesnt even load the stylesheet. So I have this in total to try and load my “MobileThemeBeta” for mobile browsers.

    `add_filter( ‘template’, ‘my_mobile_template’, 99999, 1);
    function my_mobile_template($template){
    if(wp_is_mobile())
    return ‘MobileThemeBeta’;
    return $template;
    }

    add_filter( ‘theme_root’, ‘theme_root’, 99999, 1 );
    function theme_root( $root_path ) {
    if (wp_is_mobile())
    return ‘MobileThemeBeta’;
    return $root_path;
    }

    add_filter( ‘theme_root_uri’, ‘theme_root_uri’, 99999, 1 );
    function theme_root_uri( $root_url ) {
    if (wp_is_mobile())
    return ‘MobileThemeBeta’;
    return $root_url;
    }

    add_filter( ‘stylesheet’, ‘my_mobile_stylesheet’, 999999, 1);
    function my_mobile_stylesheet($stylesheet){
    if(wp_is_mobile())
    return ‘MobileThemeBeta’;
    return $stylesheet;
    }`


    enderpal444
    Participant

    @enderpal444

    @rogercoathup How would you change it to make it work?


    enderpal444
    Participant

    @enderpal444

    Fixed. had to rename a plugin to get back into admin. Then ran the wizard and turned it back on and it works again. Fun times.

    CLOSED


    enderpal444
    Participant

    @enderpal444

    @boonebgorges @djpaul Can you toss a dog a bone on this? I’d really like to know how to do it.


    enderpal444
    Participant

    @enderpal444

    @karmatosed I had seen that but didn’t see an answer on how to do what I’m trying to do. I need a live validation to show the user whether or not their entry is a valid url for facebook or twitter.


    enderpal444
    Participant

    @enderpal444

    @djpaul @rogercoathup I was able to do it with the following code which seems to be a nice solution for scaling.

    <?php
    //these are the arguments for the get_users function below
    $args  = array(
    'fields' => 'all_with_meta',
    'role' => 'author',
    'meta_query' => array(
    array(
    'key' => 'score', // the meta field (or key) we want to target
    )
    ));
    //get_users calls WP_User_Query and returns an array of matching users
    $users = get_users($args);
    //custom function for comparing the data we want to sort by
    function cmp($a, $b){
    if ($a->score == $b->score) {
    return 0;
    }
    return ($a->score > $b->score) ? -1 : 1;
    }
    //usort sorts our $users array with our function cmp()
    usort($users, 'cmp');
    //leaving an array of $users sorted by the value of meta 'points'
    foreach ($users as $user) {
    echo '<li>';
    echo get_avatar( $user->ID, 30 );
    echo '<span>' . $user->display_name . '</span>';
    echo '</li>';
    } ?>

    enderpal444
    Participant

    @enderpal444

    Yeah that’s a concern. I have a meta value for each user which is a score for that user so I have a need to show list of top 10 scores and stuff like that.


    enderpal444
    Participant

    @enderpal444

    babump


    enderpal444
    Participant

    @enderpal444

    @hnla yeap sure did. I can’t really tell what is so different that is happening but it works lol!


    enderpal444
    Participant

    @enderpal444

    @hnla Thanks for helping. What do I add to bp_init? I tried that in the functions.php but it didn’t do the trick/


    enderpal444
    Participant

    @enderpal444

    kabump


    enderpal444
    Participant

    @enderpal444

    was just about to answer my own question..thanks paul.


    enderpal444
    Participant

    @enderpal444

    @shanebp What I want to do is limit the characters they are allowed to enter into the actual bio.


    enderpal444
    Participant

    @enderpal444

    @djpaul I don’t get it. If I set posts_per_page to -1 it shows all the posts correctly. So why isn’t it allowing to page when I set it to 8? How would you do this if it were you?


    enderpal444
    Participant

    @enderpal444

    @djpaul The loop shows the correct posts for the corresponding author on their profile. I have loop-index.php and loop-member.php and the templates are the same except the beginning of the loop. So I tested the loop-member.php on the homepage adding a specific author id and it triggers the infinite scroll but loads the same 8 posts each time.


    enderpal444
    Participant

    @enderpal444

    @djpaul Ok I rewrote it like this but it’s still not triggering after the post_per_page limit.

    `<?php
    global $bp;
    $user_id = $bp->displayed_user->id;
    $my_query = new WP_Query(‘&posts_per_page=8’ . ‘&cat=-1’ . ‘&author=’. $user_id);
    if ( $my_query->have_posts() ) : while ( $my_query->have_posts() ) : $my_query->the_post(); ?>`

    What do you recommend?

Viewing 25 replies - 1 through 25 (of 109 total)
Skip to toolbar