PHP codes for wordpress

Hello guys so I am making a car review wordpress magazine and I am having issues with php codes as I am not a great programmer. Actually on this page Memes I would like the social plugins to be below each picture and not on the top furthermore I would like it to display the post date and the author of the post. Some formatting for the pictures size etc would be great too. Below is the code I am using

<?php /*
Template Name: ListPostsInCategoryThatHasSameNameAsPage
*/ ?>

<?php get_header(); ?>

<div id="content" class="archive <?php if(get_option('colabs_layout_settings')=='two-col-right'){echo 'right';}else{?>left<?php }?>">

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <div <?php post_class(); ?> id="post_<?php the_ID(); ?>">

    <span id="map"><a href="<?php echo get_option('home'); ?>/"><?php _e('Home','colabsthemes');?></a> &raquo; <?php the_title(); ?></span>

    <h2 class="title"><?php the_title(); ?></h2>


        <div class="entry" style="padding-top:15px;">
        <?php the_content(__('<p>Read the rest of this page &raquo;</p>','colabsthemes')); ?>
        <?php echo colabs_share();?>

        <?php wp_link_pages(array('before' => __('<p><strong>Pages:</strong>','colabsthemes'), 'after' => '</p>', 'next_or_number' => 'number')); ?>

        </div>
    </div>

    <?php endwhile; else: endif; ?>


    <?php query_posts('category_name='.get_the_title().'&post_status=publish,future');?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
    <p><?php the_content(); ?>
    <?php endwhile; else: endif; ?>


</div>
</div>

<div id="sidebar" class="<?php if(get_option('colabs_layout_settings')=='two-col-right'){echo 'left';}else{?>right<?php }?>">
        <?php get_sidebar(); ?>
</div>

<div> <?php get_footer(); ?> </div>

Finally for the review part I would like to do something like Autotest/review but I don’t know which code to use to show these kind of square articles. Please help me out.

Related posts

Leave a Reply

1 comment

  1. For adding the author and date of the post, you can add:

    <p>Written by: 
    <?php get_the_author(); ?></p> 
    

    get_the_author() will display the author’s name as is set in their “Display name publicly as” field in their user profile (Administration > Users > Your Profile).

    To also display the date:

    <p>Written by: 
    <?php get_the_author(); ?> on
    <?php get_the_date(); ?></p>
    

    I don’t see where you’re using the social sharing links on the page you linked to – did you remove them?

    For more information:

    http://codex.wordpress.org/Function_Reference/get_the_author
    http://codex.wordpress.org/Function_Reference/get_the_date