boris16584
Forum Replies Created
-
Forum: Plugins
In reply to: [ZM Ajax Login & Register] Placeholderopen the file register-form.php you will see the form you can add the placeholders your self
Forum: Fixing WordPress
In reply to: options.php multiple select with options in a submit formthank you for the comment
how can i achieve something like this
i want to submit two select categories in the options.php and get the values in my front-page to show posts from spacified category that the user will choose
Forum: Fixing WordPress
In reply to: theme building wp_queryhello to all i manged to resolve my problem here the working code :
`$home_query = new WP_Query(‘category_name=Uncategorized&&posts_per_page=6’);
$post_count = 0;
if ( $home_query -> have_posts() ) : while ( $home_query -> have_posts() ) : $home_query -> the_post();?>
<?php if( !( $post_count % 3 )){ ?> <div class=”posts-wrapper row”> <?php }/*end if $post_count*/ $post_count++; ?>
<article <?php post_class(); ?> id=”post-<?php the_ID(); ?>”> <div class=”post-thumbnail”>
<?php if( !(has_post_thumbnail())){?>
/images/shop.png” data-lightbox=”<?php $category = get_the_category(get_the_ID());
if($category[0]){echo ($category[0]->cat_name);}?>” data-title=”NO IMAGE”><img class=”attachment-250×250 wp-post-image img-responsive img-thumbnail” width=”250″ height=”250″ alt=”there is no thumbnail for this post” src=”<?php echo get_template_directory_uri()?>/images/shop.png”>
<?php } else{ ?>
<?php $args = array(‘post_type’ => ‘attachment’, ‘numberposts’ => 1, ‘posts_per_page’ => 1,
‘post_status’ =>’any’, ‘post_parent’ => $post->ID ); // ‘posts_per_page’ => -1 All posts ?>
<?php $posts_ids[($post_count-1)] = $post->ID;?>
<?php $attachments = get_posts($args);
if ( $attachments ) {
foreach ( $attachments as $attachment ) {
$alt = trim(strip_tags( get_post_meta($attachment->ID, ‘_wp_attachment_image_alt’, true) ));
$image_title = $attachment->post_title;
$caption = $attachment->post_excerpt;
$description = $attachment->post_content;
$default_attr = array(
‘src’ => $src,
‘class’ => “attachment-$size”,
‘alt’ => trim(strip_tags( get_post_meta($attachment->ID, ‘_wp_attachment_image_alt’, true) )),
);?>
ID;?>” href=”<?php echo wp_get_attachment_url( $attachment->ID);?>” data-lightbox=”<?php $category = get_the_category(get_the_ID());
if($category[0]){echo ($category[0]->cat_name);}?>” data-title=”<?php echo $image_title;?>”><?php echo wp_get_attachment_image( $attachment->ID, array(220,300), $default_attr ); ?><?php
} //end foreach
} // end if ( $attachments )
} // end has_post_thumbnail?>
<p class=”img-meta clearfix”>
<em class=”date”><?php the_time(‘F jS, Y’); ?>
</p>
</div><!– end .post-thumbnail –>
<div class=”post-content”>
<div class=”entry row”>
<span class=”col-xs-9″>
<p class=”post-title”><?php the_title(); ?></p>
<p class=”post-tags”>
<?php $tags = wp_get_post_tags(get_the_ID());
if($tags)
for($i=0 ; $i < count($tags) ; $i++){
if($tags[$i+1] -> name) echo $tags[$i] -> name . ‘ , ‘ ;
else echo $tags[$i] -> name;
} // end for?>
</p>
<?php if (get_option(‘first’)){ ?>
<div id=”telno”>
<p>Tel: <?php echo get_option(‘first’); ?></p>
</div> <!– end telno –>
<?php } //end if get_option ?>
</span><!– col-xs-10 –>
<span class=”col-xs-3″>” class=”btn btn-success” ><i class=”content content_small”></i></span>
<style>
#recent-post-category .btn-success i {
background: url(“<?php echo get_template_directory_uri()?>/images/Chevron-right.png”) no-repeat scroll center center;}
</style>
</div><!– end .entry row –>
</div><!– end .post-content –>
</article>
<?php if( !( $post_count % 3 )){ ?> </div><!– posts-wrapper row –><?php } // end if $post_count?>
<?php endwhile;
endif;?>
thanks to the halpers