Posts by kaaz

360 posts
  • Microlancer Beta Tester
  • Sold between 10 000 and 50 000 dollars
  • Most Wanted Bounty Winner
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
kaaz says

sorry, that was a quick edit code

Please change those 2 lines to this

    $post_include = isset($include) && $include != '' ? explode( ',', $include) : '' ;
    $post_exclude = isset($exclude) && $exclude != '' ? explode( ',', $exclude) : '' ;

Thanks

360 posts
  • Microlancer Beta Tester
  • Sold between 10 000 and 50 000 dollars
  • Most Wanted Bounty Winner
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
kaaz says

example:

[photogallery include=”12,34,56”] //only shows posts from these IDs

[photogallery exclude=”123,134,456”] //show all posts except posts from these IDs

Note: I’ve not tested this code

add_shortcode( 'photogallery', 'shortcode_photogallery' );

function shortcode_photogallery( $atts, $content = null ) {
    extract(shortcode_atts(array(
        'exclude' => '',
        'include' => '',
    ), $atts));

    //comma separated user input IDs to array
    $post_include = isset($include) && $include != '' ? explode($include) : '' ;
    $post_exclude = isset($exclude) && $exclude != '' ? explode($exclude) : '' ;

    $loop = new WP_Query(array(
                'post_type' => 'slides',
                'post_status' => 'publish',
                'post__in' => $post_include, //array
                'post__not_in' => $post_exclude, //array
                'ignore_sticky_posts' => 1,
            ));

    $html = '';

    if( $loop->have_posts() ) :

            $html .= '<div class="photogallery">';

            while ( $loop->have_posts() ) : $loop->the_post();

                //your codes here

            endwhile; //END loop

            $html .= '</div>';

    endif;

    return $html;

}

Update : include/exclude only works with post IDs(custom post type), If you have multiple images in meta fields/meta box, all images can be included or excluded depending on the post IDs

360 posts
  • Microlancer Beta Tester
  • Sold between 10 000 and 50 000 dollars
  • Most Wanted Bounty Winner
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
kaaz says

Here is how I do.

ID : User input post IDs to include/exclude specific posts(separate with commas for multiple IDs). Exclude posts by prefixing its id with a ’-’ (minus) sign.

example usage

To exclude posts: [photogallery id=”-12,-45”]

To include posts: [photogallery id=”25,47,198”]

To include/exclude posts: [photogallery id=”-12,47,-45”]

add_shortcode( 'photogallery', 'shortcode_photogallery' );

function shortcode_photogallery( $atts, $content = null ) {
    extract(shortcode_atts(array(
        'id' => '',
    ), $atts));

    //comma separated user input IDs to array
    $ids = isset($id) && $id != '' ? explode( ',', $id ) : '' ;

    $loop = new WP_Query(array(
                'post_type' => 'slides',
                'post_status' => 'publish',
                'post__in' => $ids,    //array
                'ignore_sticky_posts' => 1,
            ));

    $html = '';

    if( $loop->have_posts() ) :

            $html .= '<div class="photogallery">';

            while ( $loop->have_posts() ) : $loop->the_post();

                //your codes here

            endwhile; //END loop

            $html .= '</div>';

    endif;

    return $html;

}

Hope this works for you

360 posts
  • Microlancer Beta Tester
  • Sold between 10 000 and 50 000 dollars
  • Most Wanted Bounty Winner
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
kaaz says

Congrats Cristi … :)

360 posts
  • Microlancer Beta Tester
  • Sold between 10 000 and 50 000 dollars
  • Most Wanted Bounty Winner
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
kaaz says

We’re in :)

360 posts
  • Microlancer Beta Tester
  • Sold between 10 000 and 50 000 dollars
  • Most Wanted Bounty Winner
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
kaaz says

Hi dianavisual,

You’re trying on a different forum, Our theme support forum is located here: http://support.kaazthemes.com/

OR

Please contact me through my profile page with your purchase code. Also you may send your site url and temporary login details, so that I can fix the installation issues.

Thank you

360 posts
  • Microlancer Beta Tester
  • Sold between 10 000 and 50 000 dollars
  • Most Wanted Bounty Winner
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
kaaz says

Off topic :

@Ivor

Could you please move one of my wedding theme to new WordPress Wedding category. I also sent you an email few days ago through your profile page.

Thank you

360 posts
  • Microlancer Beta Tester
  • Sold between 10 000 and 50 000 dollars
  • Most Wanted Bounty Winner
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
kaaz says

Here is the answer : http://www.kriesi.at/about

360 posts
  • Microlancer Beta Tester
  • Sold between 10 000 and 50 000 dollars
  • Most Wanted Bounty Winner
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
kaaz says

TF Header FF Stylish : http://pastebin.com/cBepNtCM

tf header

Large Image: http://bit.ly/1bjSMJ5

360 posts
  • Microlancer Beta Tester
  • Sold between 10 000 and 50 000 dollars
  • Most Wanted Bounty Winner
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
kaaz says

Congratulation Parallelus :)

by
by
by
by
by
by