Forum Replies Created
list of topics you have created till now.
-
-
almondpix
Participant13 September 2015 at 23:20Posted in : How to create a new [photo_wall2] shortcode?sorry, it has a some problem with a posted message.
please see this link https://www.dropbox.com/s/58yiaqft9nynlg3/issue-photowall.txt?raw=1 instead
Is it has any effect or problem with my theme? if i do like this.
Thank you for support.
almondpix
Participant13 September 2015 at 23:02Posted in : How to create a new [photo_wall2] shortcode?i try to add “rows” attribute in to themes
functions.php
@Line 2468 replace function photo_wall( $atts, $content = “” );
========================================================================
function photo_wall( $atts, $content = "" )
{
extract( shortcode_atts( array( 'animation' => "random",
'rows' => "3",
'interval' => "1600",
'max_step' => "3" ), $atts ) );$output = "";
$images = "";
$items_count = 1;$args = array( 'post_type' => 'portfolio',
'orderby' => 'rand',
'posts_per_page' => -1 );$loop = new WP_Query( $args );
if ( $loop->have_posts() ) :
while ( $loop->have_posts() ) : $loop->the_post();$post_content = get_the_content();
if ( preg_match( '/\[gallery.*ids=.(.*).\]/', $post_content, $ids ) )
{
$ids_in_array = explode( ',', $ids[1] );foreach ( $ids_in_array as $item_id )
{
$image = wp_get_attachment_image_src( $item_id, 'thumbnail' );if ( $image[0] != "" )
{
if ( $items_count <= 100 )
{
$images .= '';$items_count++;
}
}
}
}endwhile;
if ( $images != "" )
{
$output = '' . $images . '';
}endif;
wp_reset_query();return $output;
}add_shortcode( 'photo_wall', 'photo_wall' );
almondpix
Participant13 September 2015 at 22:30Posted in : How to create a new [photo_wall2] shortcode?or add new original photowall attribute named “rows” or so on. such as [photo_wall animation=”random” interval=”1600″ max_step=”3″ rows=”5″]
Thank you