• Zeus

    (@prabhakaraan)


    How to remove author and categories at meta(bottom) of the post container(column box)? and to show only published date.

    Do reply

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Zeus

    (@prabhakaraan)

    I believe that some code modification is to be made in ‘loop.php’ but I don’t know the code modification needed to achieve my above mentioned requirement. Help plz.

    <div class="meta clearfix">
    <?php
    		printf( __( '%3$s <time class="col" datetime="2011-09-28"><span class="ico">Published on</span>%2$s</time> ', 'sampression' ),'meta-prep meta-prep-author',
    		sprintf( '<a href="%4$s" title="%2$s" rel="bookmark">%3$s</a>',
    		get_permalink(),
    		esc_attr( get_the_time() ),
    		get_the_date('d M Y'),
    		get_month_link( get_the_time('Y'), get_the_time('m'))
    		),
    		printf( '<div class="post-author col"><span class="ico hello">Author</span><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></div>',
    		get_author_posts_url( get_the_author_meta( 'ID' ) ),
    		sprintf( esc_attr__( 'View all posts by %s', 'sampression' ), get_the_author() ),
    		get_the_author()
    		)
    		);
    ?>
    Thread Starter Zeus

    (@prabhakaraan)

    any help would be appreciated?

    Replace the following codes in loop.php

    <div class="meta clearfix">
    			<?php
                    printf( __( '%3$s <time class="col" datetime="2011-09-28"><span class="ico">Published on</span>%2$s</time> ', 'sampression' ),'meta-prep meta-prep-author',
    					sprintf( '<a href="%4$s" title="%2$s" rel="bookmark">%3$s</a>',
    						get_permalink(),
    						esc_attr( get_the_time() ),
    						get_the_date('d M Y'),
    						get_month_link( get_the_time('Y'), get_the_time('m'))
    					),
    					sprintf( '<div class="post-author col"><span class="ico hello">Author</span><a href="%1$s" title="%2$s">%3$s</a></div>',
    						get_author_posts_url( get_the_author_meta( 'ID' ) ),
    					sprintf( esc_attr__( 'View all posts by %s', 'sampression' ), get_the_author() ),
    						get_the_author()
    						)
                    );
                ?>
          </div>
          <div class="meta">
            <div class="cats"><?php printf(__('<span class="ico">Categories</span><div class="overflow-hidden cat-listing">%s</div>', 'sampression'), get_the_category_list(', ')); ?></div>
          </div>

    with

    <div class="meta clearfix">
    			<?php
                    printf( __( '%3$s <time class="col" datetime="2011-09-28"><span class="ico">Published on</span>%2$s</time> ', 'sampression' ),'meta-prep meta-prep-author',
    					sprintf( '<a href="%4$s" title="%2$s" rel="bookmark">%3$s</a>',
    						get_permalink(),
    						esc_attr( get_the_time() ),
    						get_the_date('d M Y'),
    						get_month_link( get_the_time('Y'), get_the_time('m'))
    					),
    					sprintf(
    						)
                    );
                ?>
          </div>

    I think this works as per your requirement.

    Thread Starter Zeus

    (@prabhakaraan)

    sorry not working! ??

    Please Replace the above lines with

    <div class="meta clearfix">
    			<?php
                    printf( __( '%3$s <time class="col" datetime="2011-09-28"><span class="ico">Published on</span>%2$s</time> ', 'sampression' ),'meta-prep meta-prep-author',
    					sprintf( '<a href="%4$s" title="%2$s" rel="bookmark">%3$s</a>',
    						get_permalink(),
    						esc_attr( get_the_time() ),
    						get_the_date('d M Y'),
    						get_month_link( get_the_time('Y'), get_the_time('m'))
    					),
    					''
                    );
                ?>
          </div>

    Please tell if it works

    Above changes is for home page and if you want to remove in single post page then some modifications on single.php page should be done
    Replace the following lines in single.php

    <?php
    					printf( __( '%3$s <time class="" datetime="2011-09-28"><span class="ico">&nbsp;</span>%2$s</time> ', 'sampression' ),'meta-prep meta-prep-author',
    						sprintf( '<a href="%4$s" title="%2$s" rel="bookmark">%3$s</a>',
    							get_permalink(),
    							esc_attr( get_the_time() ),
    							get_the_date(),
    							get_month_link( get_the_time('Y'), get_the_time('m'))
    						),
    						sprintf( '<div class="post-author"><span class="ico hello">&nbsp;</span><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></div>',
    							get_author_posts_url( get_the_author_meta( 'ID' ) ),
    						sprintf( esc_attr__( 'View all posts by %s', 'sampression' ), get_the_author() ),
    							get_the_author()
    							)
    					);
    				?>

    with

    <?php
    					printf( __( '%3$s <time class="" datetime="2011-09-28"><span class="ico">&nbsp;</span>%2$s</time> ', 'sampression' ),'meta-prep meta-prep-author',
    						sprintf( '<a href="%4$s" title="%2$s" rel="bookmark">%3$s</a>',
    							get_permalink(),
    							esc_attr( get_the_time() ),
    							get_the_date(),
    							get_month_link( get_the_time('Y'), get_the_time('m'))
    						),
    						''
    					);
    				?>

    Please tell if it works

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to edit meta clearfix?’ is closed to new replies.