Plugin Directory

Changeset 632638


Ignore:
Timestamp:
12/01/2012 09:46:14 AM (13 years ago)
Author:
anildhiman
Message:

add pagination change design

Location:
mj-news/trunk
Files:
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • mj-news/trunk/css/mj.css

    r630794 r632638  
    99}
    1010
     11
     12/* =WordPress Core
     13-------------------------------------------------------------- */
     14.alignnone {
     15    margin: 5px 20px 20px 0;
     16}
     17
     18.aligncenter,
     19div.aligncenter {
     20    display: block;
     21    margin: 5px auto 5px auto;
     22}
     23
     24.alignright {
     25    float:right;
     26    margin: 5px 0 20px 20px;
     27}
     28
     29.alignleft {
     30    float: left;
     31    margin: 5px 20px 20px 0;
     32}
     33
     34.aligncenter {
     35    display: block;
     36    margin: 5px auto 5px auto;
     37}
     38
     39a img.alignright {
     40    float: right;
     41    margin: 5px 0 20px 20px;
     42}
     43
     44a img.alignnone {
     45    margin: 5px 20px 20px 0;
     46}
     47
     48a img.alignleft {
     49    float: left;
     50    margin: 5px 20px 20px 0;
     51}
     52
     53a img.aligncenter {
     54    display: block;
     55    margin-left: auto;
     56    margin-right: auto
     57}
     58
     59.wp-caption {
     60    background: #fff;
     61    border: 1px solid #f0f0f0;
     62    max-width: 96%; /* Image does not overflow the content area */
     63    padding: 5px 3px 10px;
     64    text-align: center;
     65}
     66
     67.wp-caption.alignnone {
     68    margin: 5px 20px 20px 0;
     69}
     70
     71.wp-caption.alignleft {
     72    margin: 5px 20px 20px 0;
     73}
     74
     75.wp-caption.alignright {
     76    margin: 5px 0 20px 20px;
     77}
     78
     79.wp-caption img {
     80    border: 0 none;
     81    height: auto;
     82    margin: 0;
     83    max-width: 98.5%;
     84    padding: 0;
     85    width: auto;
     86}
     87
     88.wp-caption p.wp-caption-text {
     89    font-size: 11px;
     90    line-height: 17px;
     91    margin: 0;
     92    padding: 0 4px 5px;
     93}
     94
     95
     96
     97/* css for news */
     98div#mjnew{  font-family: 'MyriadProRegular';}
     99div#mjnew h3 {    border-bottom: 1px solid #DDDDDD;    font-size: 17px;    line-height: 1.5em;    text-transform: capitalize;}
     100.mj-post-inner {    border: 1px solid #DDDDDD;    /* margin-bottom: 4px;   */  padding: 11px 14px;}
     101.mjfooter .fr{float: right;}
     102.mjfooter .fl{float: left;}
     103.clr{clear: both; height:0px;display:block;}
     104.mjfooter {    background: none repeat scroll 0 0 #DDDDDD;    margin: 0 0 19px;    padding: 0 17px;}
     105#mjnew .page_nav a{ background: none repeat scroll 0 0 #DDDDDD;    color: gray;    padding: 6px;}
     106#mjnew .page_nav span{background: none repeat scroll 0 0 gray;    border: 1px solid;    color: #FFFFFF;    padding: 6px;}
     107/* css for news */
  • mj-news/trunk/index.php

    r630794 r632638  
    1515
    1616
     17add_action("wp_enqueue_scripts", "mjnewsStyle");
     18function mjnewsStyle() {
     19   wp_register_style( 'mjnewform', plugins_url( '/css/mj.css', __FILE__ ),'all' ); 
     20   wp_enqueue_style( 'mjnewform' ); 
     21}
     22 
     23 
    1724
    1825function mj_news_type_creation() {
     
    4754?>
    4855
    49 <div id="accordion">
     56<div id="mjnew">
    5057    <?php   
    51     query_posts("post_type=News&post_status=publish");
     58   
     59    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
     60    $args=array(
     61    'post_type'         => 'news',
     62    'post_status'        => 'publish',
     63    //'orderby'                    => 'menu_order',
     64    'posts_per_page'         =>4,
     65    'caller_get_posts'            =>1,
     66    'paged'            =>$paged,
     67    );
     68    query_posts($args);
    5269    global $post;
    5370    if ( have_posts() ) : while ( have_posts() ) : the_post();
    5471   
    5572    ?>
    56     <h3>
    57         <a href="#"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
    58     </h3>
    59     <span><?php echo date('d F, Y',strtotime($post->post_date));?></span>
    60     <div><?php echo substr(get_the_content(),0,200); ?></div>
    61     <div><a href="<?php echo get_permalink();?>">Read More</a></div>
    62 
     73        <div class="mj-post">
     74            <div class="mj-post-inner">
     75                <h3>
     76                    <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
     77                </h3>
     78                <div><?php echo substr(get_the_content(),0,200); ?></div>
     79                <div><a href="<?php echo get_permalink();?>">Read More</a></div>
     80            </div>
     81            <div class="mjfooter"><span class="fl">Posted by : <?php echo the_author();?></span><span class="fr">Posted on : <?php echo date('d F, Y',strtotime($post->post_date));?></span>
     82            <div class="clr"></div>
     83            </div>
     84        </div>
    6385    <?php
    6486   
    6587    endwhile;
    6688    endif; ?>
    67 </div>
     89
    6890<?php
     91
     92
     93
     94global $wp_query; 
     95$total_pages = $wp_query->max_num_pages; 
     96if ($total_pages > 1){ 
     97  $current_page = max(1, get_query_var('paged')); 
     98  echo '<div class="page_nav">'; 
     99  echo paginate_links(array( 
     100      'base' => get_pagenum_link(1) . '%_%', 
     101      'format' => '/page/%#%', 
     102      'current' => $current_page, 
     103      'total' => $total_pages, 
     104      'prev_text' => 'Prev', 
     105      'next_text' => 'Next' 
     106    )); 
     107  echo '</div>'; 
     108}
     109echo "</div>";
    69110    wp_reset_query();
    70111}
  • mj-news/trunk/readme.txt

    r630794 r632638  
    2424<li> - category news.</li>
    2525<li> - news tags.</li>
     26<li> - Pagination</li>
    2627<li> - custom fields.</li>
    2728<li> - easy to install.</li>
     
    3132   mj_news(); php code</li>
    3233<li> - easy to understand coding standard</li>
     34
    3335</ul>
    3436
Note: See TracChangeset for help on using the changeset viewer.