Wordpress - Show the_excerpt of post on facebook share - php
i'm looking a way to display the-excerpt of post when Sharing on facebook, here is my code, but it doenst show the_exceprt of the post . ..
<a <a target="_blank" href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&t= <?php the_excerpt(); ?><?php the_title(); ?>"<i class="fa fa-facebook"></i></a>
If it can help, this is the section with the all code ( it's a grid system, each box of the "grid" has different content)
<div data-ratio="1" class="grid__item grid__item_inline one-half cell tabbed" style="background-color: #ccffff" >
<h1>Press room</h1>
<?php
$query = new WP_Query( array( 'post_type' => 'coverage', 'posts_per_page' => 1 ) );
if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post();
?>
<time class="timestamp"><?php the_date(); ?></time>
<h2 class="h4"><?php the_title(); ?></h2>
<div class="palm--hidden"><?php the_excerpt(); ?><p></p></div>
Read More
<div class="social-icons-2">
<ul class="hl">
<li>Share:</li>
<li><a <a target="_blank" href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&t= <?php the_excerpt(); ?><?php the_title(); ?>"<i class="fa fa-facebook"></i></a></li>
<li><i class="fa fa-twitter"></i></li>
<li><i class="fa fa-pinterest"></i></li>
</ul>
</div>
<?php
endwhile; endif;
?>
</div>
</article>
</div>
ANother question related with this facebook share, at the moment it's sharing the logo of the website . . any possiblity to show insterad the picture attach of the post ?
Thank you so much for all your time in advance
EDIT: I put here all the code of the page in case it heelps . ..
<?php get_header(); ?>
<div id="slider-header">
<div class="container">
<div class="row">
<div class="col-sm-4 slider-header-left">
WHAT WE DO
</div>
<div class="col-sm-8 slider-header-right">
texttt
</div>
</div>
</div>
</div>
<div id="main" class="site-main" role="main">
<div id="home-slider">
<div class="container">
<div class="row home-content-slider">
<?php
$services = get_page_by_path('services');
if($services) $parent = $services->ID;
$the_query = new WP_Query( array( 'post_type' => 'page', 'post_per_page' => 5, 'post_parent' => $parent, 'order' => 'ASC' ) );
$service_titles = array();
$service_images = array();
if ( $the_query->have_posts() ) {
$i = 1;
while ( $the_query->have_posts() ) {
$the_query->the_post();
$service_titles[] = '<li id="nav-fragment-'. $i .'" class=""><a href="#fragment-'. $i .'" ><span>'. get_the_title() .'</span></a></li>';
$post_thumbnail_id = get_post_thumbnail_id( $post->ID );
$image = wp_get_attachment_image_src( $post_thumbnail_id, 'full' );
$service_images[] = '<div id="fragment-'. $i .'" class="ui-tabs-panel ui-tabs-hide"><img src="'. $image[0] .'" title="" /><div class="overlay-description">'. get_field('slider_text') .'</div></div>';
$i++;
}
}
wp_reset_postdata();
?>
<div class="col-sm-4 home-slider-left">
<div class="row">
<ul>
<?php echo implode( "\n", $service_titles ); ?>
</ul>
</div>
</div>
<div class="col-sm-8 home-slider-right">
<div class="row">
<?php echo implode( "\n", $service_images ); ?>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<div id="grid_container">
<div class="row">
<div class="col-sm-6 news-post" style="background-color: #ccfff" data-key="newsItem">
<article class="grid row">
<div data-ratio="1" class="grid__item grid__item_inline one-half">
<?php
echo '<div class="flexslider">';
echo '<ul class="slides">';
$query = new WP_Query( array( 'post_type' => 'coverage', 'posts_per_page' => 9 ) );
if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post();
$post_thumbnail_id = get_post_thumbnail_id( $post->ID );
$image = wp_get_attachment_image_src( $post_thumbnail_id, 'homepage-thumb' );
if($image) echo '<li><img class="img-responsive" src="'. $image[0] .'" alt="" /></li>';
endwhile; endif;
echo '</ul>';
echo '</div>';
?>
<?php wp_reset_postdata(); ?>
</div>
<div data-ratio="1" class="grid__item grid__item_inline one-half cell tabbed" style="background-color: #ccffff" >
<h1>Press room</h1>
<?php
$query = new WP_Query( array( 'post_type' => 'coverage', 'posts_per_page' => 1 ) );
if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post();
?>
<time class="timestamp"><?php the_date(); ?></time>
<h2 class="h4"><?php the_title(); ?></h2>
<div class="palm--hidden"><?php the_excerpt(); ?><p></p></div>
Read More
<div class="social-icons-2">
<ul class="hl">
<li>Share:</li>
<li><a <a target="_blank" href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&t= <?php the_excerpt(); ?><?php the_title(); ?>"<i class="fa fa-facebook"></i></a></li>
<li><i class="fa fa-twitter"></i></li>
<li><i class="fa fa-pinterest"></i></li>
</ul>
</div>
<?php
endwhile; endif;
?>
</div>
</article>
</div>
<div class="col-sm-6 news-post" style="background-color: #ffcccc" data-key="newsItem">
<article class="grid row">
<?php
$query = new WP_Query( array( 'post_type' => 'news', 'posts_per_page' => 1 ) );
if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post();
?>
<div data-ratio="1" class="grid__item grid__item_inline one-half">
<figure data-ratio="1">
<?php
$post_thumbnail_id = get_post_thumbnail_id( $post->ID );
$image = wp_get_attachment_image_src( $post_thumbnail_id, 'homepage-thumb' );
?>
<img width="640" height="640" class="img-responsive" src="<?php echo $image[0]; ?>" alt="" />
</figure>
</div>
<div data-ratio="1" class="grid__item grid__item_inline one-half cell tabbed" style="background-color: #ffcccc" >
<h1>NEWS</h1>
<time class="timestamp"><?php the_date(); ?></time>
<h2 class="h4"><?php the_title(); ?></h2>
<div class="palm--hidden"><p><?php the_excerpt(); ?></p></div>
Read More
<div class="social-icons-2">
<ul class="hl">
<li>Share:</li>
<li><i class="fa fa-facebook"></i></li>
<li><i class="fa fa-twitter"></i></li>
<li><i class="fa fa-pinterest"></i></li>
</ul>
</div>
</div>
<?php
endwhile; endif;
?>
</article>
</div>
<div class="col-sm-6 news-post" style="background-color: #ffffff" data-key="newsItem">
<article class="grid row">
<div data-ratio="1" class="grid__item one-half">
<figure data-ratio="1">
<!-- SnapWidget -->
<!-- SnapWidget -->
<!-- SnapWidget -->
<iframe src="http://snapwidget.com/sc/?u=aW5fc3BhY2VzfGlufDI4MHwzfDN8fG5vfDV8bm9uZXx8eWVzfG5v&ve=020914" title="Instagram Widget" class="snapwidget-widget" allowTransparency="true" frameborder="0" scrolling="no" style="border:none; overflow:hidden; width:295px; height:295px"></iframe>
</figure>
</div>
<div data-ratio="1" class="grid__item grid__item_inline one-half cell tabbed twitter-widget" style="background-color: #ffffff" >
<a class="twitter-timeline" data-dnt="true" href="sm2" data-widget-id="501148708545638400">Tweets by #In__Spaces</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>
</article>
</div>
<div class="post-1410 post type-post status-publish format-standard has-post-thumbnail hentry category-news col-sm-6 news-post" style="background-color: #ffffcc" data-key="newsItem">
<article class="grid row">
<?php
$query = new WP_Query( array( 'post_type' => 'event', 'posts_per_page' => 1 ) );
if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post();
?>
<div data-ratio="1" class="grid__item grid__item_inline one-half">
<figure data-ratio="1">
<?php
$post_thumbnail_id = get_post_thumbnail_id( $post->ID );
$image = wp_get_attachment_image_src( $post_thumbnail_id, 'homepage-thumb' );
?>
<img width="640" height="640" class="img-responsive" src="<?php echo $image[0]; ?>" alt="" />
</figure>
</div>
<div data-ratio="1" class="grid__item grid__item_inline one-half cell tabbed" style="background-color: #ffffcc" >
<h1>EVENTS</h1>
<time class="timestamp">August 22, 2014</time>
<h2 class="h4"><?php the_title(); ?></h2>
<div class="palm--hidden"><p><?php the_excerpt(); ?></p></div>
Read More
<div class="social-icons-2">
<ul class="hl">
<li>Share:</li>
<li><i class="fa fa-facebook"></i></li>
<li><i class="fa fa-twitter"></i></li>
<li><i class="fa fa-pinterest"></i></li>
</ul>
</div>
</div>
<?php
endwhile; endif;
?>
</article>
</div>
<div class="big-link">
</div>
</div>
</div>
</div>
</div><!-- #main -->
<?php get_footer(); ?>
You need to use Open Graph Tags in the <head> section of your page.
Here's an example:
<meta property="og:title" content="<?=the_title();?>" />
<meta property="og:description" content="<?=the_excerpt();?>" />
<meta property="og:type" content="blog" />
<meta property="og:url" content="<?=the_permalink();?>" />
<meta property="og:site_name" content="YOUR_SITE_NAME" />
Related
how to add pagination in child posts list
I created a custom post type called Programs, Each program contains episodes Episodes will be Child Post Some programs contain more than a hundred episodes, so I want to add pagination to my child posts list I've had a basic attempt at this using $paged = (get_query_var('page')) ? get_query_var('page') : 1; and the paged argument in the WP_Query, but my next_posts_link doesn't work. my code to show child post <?php $args = array( 'post_type' => 'programs', 'posts_per_page' => 60, 'post_parent' => $post->ID, 'order' => 'ASC', ); $parent = new WP_Query( $args ); if ( $parent->have_posts() ) : ?> <div class="penci-border-arrow penci-homepage-title penci-magazine-title style-5 pcalign-right pciconp-right pcicon-right" style="border-color: #3E68B0"> <h3 class="inner-arrow" style="background:#3E68B0;border-color: #3E68B0"> الحلقات </h3> </div> <ul class="penci-wrapper-data penci-grid"> <?php while ( $parent->have_posts() ) : $parent->the_post(); $featured_img_url = get_the_post_thumbnail_url(get_the_ID()); $episode_number = get_field('episode_number', get_the_ID()); ?> <li class="list-post pclist-layout"> <article id="post-<?php the_ID(); ?>" class="item hentry"> <div class="thumbnail child-thumbnail"> <a class="penci-image-holder penci-lazy" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" style="background-image: url(<?php echo $featured_img_url?>);"> </a> </div> <div class="content-list-right content-list-center child-content"> <div class="header-list-style"> <div class="episode-details"> <span class=""> <a class="url fn n" href="<?php the_permalink(); ?>"><?php echo $episode_number ?></a></span> <span style="margin:0 20px"><a>|</a></span> <span class="featc-date"><time class="entry-date published" datetime="2021-10-31T13:26:29+00:00">2021-10-31</time> </span> <span class='program-viewcn'><?php pvc_stats_update( get_the_ID(), 1 ); ?></span> </div> <h2 class="grid-title entry-title"> <?php the_title(); ?> </h2> </div> <div class="item-content entry-content"> <p> <?php the_excerpt();?> </p> </div> </div> </article> </li> <?php endwhile; ?> </ul> <?php endif; ?>
how to add pagination to child post
I created custom post type and child post , i want to add pagination to child post , I've had a basic attempt at this using $paged = (get_query_var('page')) ? get_query_var('page') : 1; and the paged argument in the WP_Query, but my next_posts_link doesn't work. my code to show child post <?php $args = array( 'post_type' => 'programs', 'posts_per_page' => 60, 'post_parent' => $post->ID, 'order' => 'ASC', ); $parent = new WP_Query( $args ); if ( $parent->have_posts() ) : ?> <div class="penci-border-arrow penci-homepage-title penci-magazine-title style-5 pcalign-right pciconp-right pcicon-right" style="border-color: #3E68B0"> <h3 class="inner-arrow" style="background:#3E68B0;border-color: #3E68B0"> الحلقات </h3> </div> <ul class="penci-wrapper-data penci-grid"> <?php while ( $parent->have_posts() ) : $parent->the_post(); $featured_img_url = get_the_post_thumbnail_url(get_the_ID()); $episode_number = get_field('episode_number', get_the_ID()); ?> <li class="list-post pclist-layout"> <article id="post-<?php the_ID(); ?>" class="item hentry"> <div class="thumbnail child-thumbnail"> <a class="penci-image-holder penci-lazy" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" style="background-image: url(<?php echo $featured_img_url?>);"> </a> </div> <div class="content-list-right content-list-center child-content"> <div class="header-list-style"> <div class="episode-details"> <span class=""> <a class="url fn n" href="<?php the_permalink(); ?>"><?php echo $episode_number ?></a></span> <span style="margin:0 20px"><a>|</a></span> <span class="featc-date"><time class="entry-date published" datetime="2021-10-31T13:26:29+00:00">2021-10-31</time> </span> <span class='program-viewcn'><?php pvc_stats_update( get_the_ID(), 1 ); ?></span> </div> <h2 class="grid-title entry-title"> <?php the_title(); ?> </h2> </div> <div class="item-content entry-content"> <p> <?php the_excerpt();?> </p> </div> </div> </article> </li> <?php endwhile; ?> </ul> <?php endif; ?>
Is it possible to redirect the user to the first page of pagination if the pagination is empty In wordpress
I am trying to redirect the user to the first page of the pagination if the pagination is empty. I have three bootstrap tabs (Both, Blog, News). The blog tab contains 5 posts. The news tab contains more than 12 posts. I am displaying 6 posts per page. The issue here is that if I am on the second page of News tab and click the Blog tab, the second page of the blog tab is opening (which does not exist). For better Understanding Here is my code. <ul class="nav nav-tabs" id="myTab"> <li class="nav-item"> Section A </li> <li class="nav-item"> Section B </li> <li class="nav-item"> Section C </li> </ul> <div class="tab-content" id="myTabContent"> <div id="sectionA" class="tab-pane fade show active"> <?php if(1 != $paged) { } ?> <section class="vendor-section-2 mt-5"> <div class="container"> <div class="row"> <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $the_query = new WP_Query( array( 'posts_per_page' => 6, 'post_type' => 'post', 'paged' => $paged ) ); $page_amount = $the_query->max_num_pages; ?> <div class="container pagination-count"> <div class="row"> <div class="col-6"> <p>Page <span><?php echo $paged ?></span> of <span><?php echo $page_amount ?></span> </p> </div> </div> </div> <?php if( $the_query->have_posts() ) : while( $the_query->have_posts() ): $the_query->the_post(); $post_id = get_the_ID(); ?> <div class="col-md-4 mt-5"> <div class="card"> <img src="<?php the_post_thumbnail_url() ?>" class="card-img-top" alt="..."> <div class="card-body"> <h2 class="card-title"><?php the_title() ?></h2> <p class="card-text"><?php the_excerpt(); ?></p> <a href="<?php the_permalink() ?>" class="read-more" > <svg xmlns="http://www.w3.org/2000/svg" width="24.111" height="23.646" viewBox="0 0 24.111 23.646" style="margin-right: 10px; margin-top: -5px;"> <path id="Path_84" data-name="Path 84" d="M9.544.241a3.061,3.061,0,0,1,3.348.642c1.4,1.427,4.322,1.638,5.638,2.976,1.49,1.518,1.358,4.151,2.856,5.584a7.9,7.9,0,0,1,2.163,8.913,7.942,7.942,0,0,1-3.789,4.323c-6.319,2.6-14.617-.268-18.3-5.889-1.8-2.745-2.12-6.848.122-9.133C3.947,5.245,5.608,1.887,9.544.241Z" fill="#f3943f" /> </svg> Read More </a> </div> </div> </div> <?php endwhile; wp_reset_postdata(); endif;?> <div class="next-prev-btn"> <!-- then the pagination links --> <?php next_posts_link( 'Next →', $the_query ->max_num_pages); ?> <?php previous_posts_link( 'Previous ← ' ); wp_reset_query();?> </div> </div> </div> </section> </div> <div id="sectionB" class="tab-pane fade"> <section class="vendor-section-2 mt-5"> <div class="container"> <div class="row"> <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $the_query = new WP_Query( array( 'posts_per_page' => 6, 'post_type' => 'post', 'category_name' => 'blog', 'paged' => $paged ) ); $page_amount = $the_query->max_num_pages; ?> <div class="container pagination-count"> <div class="row"> <div class="col-6"> <p>Page <span><?php echo $paged ?></span> of <span><?php echo $page_amount ?></span> </p> </div> </div> </div> <?php if( $the_query->have_posts() ) : while( $the_query->have_posts() ): $the_query->the_post(); $post_id = get_the_ID(); ?> <div class="col-md-4 mt-5"> <div class="card"> <img src="<?php the_post_thumbnail_url() ?>" class="card-img-top" alt="..."> <div class="card-body"> <h2 class="card-title"><?php the_title() ?></h2> <p class="card-text"><?php the_excerpt(); ?></p> <a href="<?php the_permalink() ?>" class="read-more" > <svg xmlns="http://www.w3.org/2000/svg" width="24.111" height="23.646" viewBox="0 0 24.111 23.646" style="margin-right: 10px; margin-top: -5px;"> <path id="Path_84" data-name="Path 84" d="M9.544.241a3.061,3.061,0,0,1,3.348.642c1.4,1.427,4.322,1.638,5.638,2.976,1.49,1.518,1.358,4.151,2.856,5.584a7.9,7.9,0,0,1,2.163,8.913,7.942,7.942,0,0,1-3.789,4.323c-6.319,2.6-14.617-.268-18.3-5.889-1.8-2.745-2.12-6.848.122-9.133C3.947,5.245,5.608,1.887,9.544.241Z" fill="#f3943f" /> </svg> Read More </a> </div> </div> </div> <?php endwhile; wp_reset_postdata(); endif;?> <div class="next-prev-btn"> <!-- then the pagination links --> <?php next_posts_link( 'Next →', $the_query ->max_num_pages); ?> <?php previous_posts_link( 'Previous ← ' ); wp_reset_query();?> </div> </div> </div> </section> </div> <div id="sectionC" class="tab-pane fade"> <section class="vendor-section-2 mt-5"> <div class="container"> <div class="row"> <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $the_query = new WP_Query( array( 'posts_per_page' => 6, 'post_type' => 'post', 'category_name' => 'news', 'paged' => $paged ) ); $page_amount = $the_query->max_num_pages; ?> <div class="container pagination-count"> <div class="row"> <div class="col-6"> <p>Page <span><?php echo $paged ?></span> of <span><?php echo $page_amount ?></span> </p> </div> </div> </div> <?php if( $the_query->have_posts() ) : while( $the_query->have_posts() ): $the_query->the_post(); $post_id = get_the_ID(); ?> <div class="col-md-4 mt-5"> <div class="card"> <img src="<?php the_post_thumbnail_url() ?>" class="card-img-top" alt="..."> <div class="card-body"> <h2 class="card-title"><?php the_title() ?></h2> <p class="card-text"><?php the_excerpt(); ?></p> <a href="<?php the_permalink() ?>" class="read-more" > <svg xmlns="http://www.w3.org/2000/svg" width="24.111" height="23.646" viewBox="0 0 24.111 23.646" style="margin-right: 10px; margin-top: -5px;"> <path id="Path_84" data-name="Path 84" d="M9.544.241a3.061,3.061,0,0,1,3.348.642c1.4,1.427,4.322,1.638,5.638,2.976,1.49,1.518,1.358,4.151,2.856,5.584a7.9,7.9,0,0,1,2.163,8.913,7.942,7.942,0,0,1-3.789,4.323c-6.319,2.6-14.617-.268-18.3-5.889-1.8-2.745-2.12-6.848.122-9.133C3.947,5.245,5.608,1.887,9.544.241Z" fill="#f3943f" /> </svg> Read More </a> </div> </div> </div> <?php endwhile; wp_reset_postdata(); endif;?> <div class="next-prev-btn"> <!-- then the pagination links --> <?php next_posts_link( 'Next →', $the_query ->max_num_pages); ?> <?php previous_posts_link( 'Previous ← ' ); wp_reset_query();?> </div> </div> </div> </section> </div> </div> <script> $(document).ready(function(){ $('a[data-toggle="tab"]').on('show.bs.tab', function(e) { localStorage.setItem('activeTab', $(e.target).attr('href')); }); var activeTab = localStorage.getItem('activeTab'); if(activeTab){ $('#myTab a[href="' + activeTab + '"]').tab('show'); } }); </script>
Page_navi plugin create but its not working
page / 2 / is going but the homepage always appears help <div class="row"> <div class="col-md-8"> <?php $query = new WP_Query('post_type=homee');?> <?php if ( $query->have_posts() ) : while ($query->have_posts() ) : $query->the_post();?> <div class="card mt-4"> <a href="<?php the_field('homecard-link');?>" class='card-header-h'><h3 class="card-title m-2"> <div class="card-footer text-muted "> <i class="fas fa-table text-warning"></i> Post Tarihi <?php the_field('homepost-history');?> </div> <a href="<?php the_field('homecard-link');?>"><img src="<?php the_field('homeimage');?>" class="card-img-top img-thumbnail"> <div class="card-body"> <p class="card-text"><?php the_field('homecard-text');?></p> <a class="more" href="<?php the_field('homecard-link');?>"><button type="button" class="btn btn-dark more"> Devamını Oku </div> <?php endwhile; ?> <?php else : ?> <p><?php esc_html_e( 'Üzgünüz, Sayfa Bulunamadı' ); ?></p> <?php endif; wp_pagenavi(array( 'query' => $query )); `this problem` wp_reset_query(); `this problem` ;?>
Please try and replace wp query <?php $query = new WP_Query('post_type=homee', 'paged' => get_query_var( 'paged' ));?>
Wordpress Loop in custom pages template for blog list is not working
I have created a Blog list through wordpress custom page template and assigned the same by creating a blog page. But I am wondering the loop is correct but its not displaying any result. http://projects.dev2d.com/msleximus/blog/ What to do. My Code .... <?php /* Template Name: Blog */ get_header(); ?> <!-- #primary --> <div role="main" class="main"> <section class="page-top"> <div class="container"> <div class="row"> <div class="span12"> <ul class="breadcrumb"> <li>Home <span class="divider">/</span></li> <li class="active"> <?php wp_title(); ?> </li> </ul> </div> </div> <div class="row"> <div class="span12"> <h2> Blog </h2> </div> </div> </div> </section> <div class="container"> <div class="row"> <div class="span9"> <?php if ( is_page() ) { $category = get_post_meta( $posts[0]->ID, 'category', true ); $cat = get_cat_ID( $category ); } if ( $cat ) : $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; $post_per_page = 4; // -1 shows all posts $do_not_show_stickies = 1; // 0 to show stickies $args=array ( 'category__in' => array( $cat ), 'post_type'=> 'post', 'orderby' => 'date', 'order' => 'DESC', 'paged' => $paged, 'posts_per_page' => $post_per_page, 'ignore_sticky_posts' => $do_not_show_stickies ); $temp = $wp_query; // assign original query to temp variable for later use global $wp_query; $wp_query = null; $wp_query = new WP_Query( $args ); if ( $wp_query->have_posts() ) : while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?> <div class="blog-posts"> <article <?php post_class() ?> id="post-<?php the_ID(); ?>class="post post-medium-image"> <div class="row"> <div class="span4"> <div class="post-image"> <div class="flexslider flexslider-center-mobile flexslider-simple" data-plugin-options='{"controlNav":false, "animation":"slide", "slideshow": false, "maxVisibleItems": 1}'> <ul class="slides"> <li> <img class="img-rounded" src="<?php the_post_thumbnail('medium'); ?>" alt="featured image"></li> </ul> </div> </div> </div> <div class="span5"> <div class="post-content"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"> <?php the_title(); ?> </a></h2> <?php the_content( 'read more »' ); ?> </div> </div> </div> <div class="row"> <div class="span9"> <div class="post-meta"> <span><i class="icon-calendar"></i> <?php the_time( 'F jS, Y' ) ?> </span> <span><i class="icon-user"></i> By <a href="#"> <?php the_author() ?> </a> </span> <span><i class="icon-tag"></i> <?php the_tags( 'Tags: ', ', ', '<br />' ); ?> ,</span> <span><i class="icon-comments"></i> <?php comments_popup_link( 'No Comments »', '1 Comment »', '% Comments »' ); ?> Read more... </div> </div> </div> </article> <?php endwhile; ?> <div class="pagination pagination-large pull-right"> <div class="alignleft"> <?php next_posts_link( '« Older Entries' ) ?> </div> <div class="alignright"> <?php previous_posts_link( 'Newer Entries »' ) ?> </div> </div> </div> </div> <?php endif; // if ( $wp_query->have_posts() ) ?> <?php $wp_query = $temp; //reset back to original query ?> <div class="span3"> <aside class="sidebar"> <?php get_search_form(); ?> <?php get_sidebar(); ?> <div class="tabs"> <ul class="nav nav-tabs"> <li class="active"><i class="icon-star"></i> Popular</li> <li>Recent</li> </ul> <div class="tab-content"> <div class="tab-pane active" id="popularPosts"> <?php fanciedmedia_popular_posts(5); ?> </div> <div class="tab-pane" id="recentPosts"> </div> </div> </div> <hr /> </aside> </div> <?php else : ?> <div class="row"> <div class="span12"> <div class="post-content"> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> </div> </div> </div> <?php endif; // if ( $cat ) ?> </div> </div> </div> <?php get_footer(); ?>
Use this one and do let me know .. <div class="container"> <div class="row"> <div class="span9"> <div class="blog-posts"> <?php query_posts('category_name = Category&showposts=10'); ?> <?php while (have_posts()) : the_post() ?> <article <?php post_class() ?> id="post-<?php the_ID(); ?>class="post post-medium-image"> <div class="row"> <div class="span4"> <div class="post-image"> <div class="flexslider flexslider-center-mobile flexslider-simple" data-plugin-options='{"controlNav":false, "animation":"slide", "slideshow": false, "maxVisibleItems": 1}'> <?php if ( has_post_thumbnail() ) { the_post_thumbnail('medium'); } ?> </div> </div> </div> <div class="span5"> <div class="post-content"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"> <?php the_title(); ?> </a></h2> <?php the_excerpt(); ?> Read more... </div> </div> </div> <div class="row"> <div class="span9"> <div class="post-meta"> <span><i class="icon-calendar"></i> <?php the_time( 'F jS, Y' ) ?> </span> <span><i class="icon-user"></i> By <a href="#"> <?php the_author() ?> </a> </span> <span><i class="icon-tag"></i> <?php the_tags( 'Tags: ', ', ', '<br />' ); ?> ,</span> <span><i class="icon-comments"></i> <?php comments_popup_link( 'No Comments »', '1 Comment »', '% Comments »' ); ?> </div> </div> </div> </article> <?php endwhile; ?> <?php global $wp_query; $total_pages = $wp_query->max_num_pages; if ( $total_pages > 1 ) { ?> <div class="pagination pagination-large pull-right"> <div class="alignleft"> <div class="nav-next alignright"> <?php previous_posts_link( 'Newer posts' ); ?> </div> </div> <div class="alignright"> <div class="nav-previous alignleft"> <?php next_posts_link( 'Older posts' ); ?> </div> </div> </div> <?php } ?> </div> </div>