Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $cat = get_option('query_slider_category');
- $catslug = get_cat_name( $cat );
- $args=array('category_name'=>$catslug, 'post_status' => 'publish','posts_per_page' => 5);
- query_posts($args);
- while (have_posts()) : the_post();
- $img = "";
- if (has_post_thumbnail()) {
- $imagedata = simplexml_load_string(get_the_post_thumbnail());
- $img = $imagedata->attributes()->src;
- }
- if ($post->post_content<>substr($post->post_content,0,70)){ $dots2 = "...";}else{$dots2 = "";}
- $cont = substr($post->post_content,0,70);
- if ($post->post_title<>substr($post->post_title,0,26)){ $dots3 = "...";}else{$dots3 = "";}
- $title1 = substr($post->post_title,0,26);
- $pageURL = 'http';
- if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
- $pageURL .= "://";
- if ($_SERVER["SERVER_PORT"] != "80") {
- $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
- } else {
- $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
- }
- $postslug = get_post_slug($post->ID);
- if ($img !== "") {
- echo "<li class='carousel_fix'><a href='$img' class='pirobox' title='$title1'><img class='slider_img_holder' id='".$pageURL.$postslug."' src='";echo bloginfo('template_directory')."/scripts/timthumb.php?src=".$img."&w=185&h=114&zc=1&q=100'></a><a class='slider_title_holder' href='".$pageURL.$postslug."'>$title1$dots3</a><span class='slider_content_holder'>$cont$dots2</span></li>" ;
- }
- endwhile;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement