how can i use php
-
Hello guys,
First thanks. This plugins working awesome….
Now i have a question. Sorry i dont know much php.
Normally i use post pages this code
<div class="thumbnails"> <div class="wrap1"> <div class="wrap2"> <div class="ubar"><?php $thetitle = $post->post_title; /* or you can use get_the_title() */ $getlength = strlen($thetitle); $thelength = 30; echo substr($thetitle, 0, $thelength); if ($getlength > $thelength) echo "..."; ?></div> <a href="<?php the_permalink(); ?>" target="_blank" itemprop="url"><img src="<?php echo wp_get_attachment_thumb_url( get_post_thumbnail_id( $post->ID ) ); ?>" onload="this.style.opacity='1'" class="thumbnail" alt="<?php the_title(); ?>" title="<?php the_title(); ?> Wallpaper" itemprop="thumbnailUrl" width="300" height="200"> </a> <div class="bbar"> <?php $attachment_id = get_post_thumbnail_id(); $image_attributes = wp_get_attachment_image_src( $attachment_id, 'full' );if( $image_attributes ) {?> <?php $width = $image_attributes[1]; $height = $image_attributes[2]; ?> <?php } ?> <?php $fsize = filesize(get_attached_file($attachment_id));$file_size = round($fsize/1024);echo '' . $width. 'x' . $height . ' px';?> / <?php echo getPostViews(get_the_ID());?> hits</div> </div> </div> </div>
Now i turned this plugin code like this;
<?php wpp_get_mostpopular( 'range=monthly&limit=40&thumbnail_width=300&thumbnail_height=200&post_type=post&post_html=" <a href=\'{url}\'> <div class=\'thumbnails\'> <div class=\'wrap2\'> <div class=\'ubar\' style=\'color: #fff;max-width: 300px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;\'> {text_title} </div> {thumb_img} </div> </div></a>"' ); ?>
But i cant use php codes. how can i use php in “post_html=”
Sorry my english not great. Hope understand me…
thank you very much…
https://www.ads-software.com/plugins/wordpress-popular-posts/
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘how can i use php’ is closed to new replies.