Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #3211
    lordnikkon
    Participant

    I am trying to create profile page that shows users content and want to include galleries they have created. I want to be able to display all the galleries that a user has created on this page. Is there a way to do this in php in the template file for the page i am creating?

    #3269
    Rattus
    Keymaster

    Try something like this:

    global $wpdb, $user_ID;
    $gallery_ids = $wpdb->get_results($wpdb->prepare("SELECT gid FROM {$wpdb->prefix}flag_gallery WHERE status = 0 AND author = %d ORDER BY gid DESC", $user_ID));
    if(!empty($gallery_ids)){
    	echo do_shortcode('[flagallery gid='.implode(",",$gallery_ids).' w=100% h=500 name="Gallery"]');
    }
    
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘GRAND Flagallery WordPress plugin’ is closed to new topics and replies.
Forum closed. Use forum at Wordpress.org: Gmedia Support Forum