Skip to content

Instantly share code, notes, and snippets.

@mmh4560
Last active July 26, 2018 16:59
Show Gist options
  • Save mmh4560/b9b0d4bff275fcfd9a1351670e95e9b2 to your computer and use it in GitHub Desktop.
Save mmh4560/b9b0d4bff275fcfd9a1351670e95e9b2 to your computer and use it in GitHub Desktop.
<?php get_header(); ?>
<div class="content-outer-wrap">
<div class="content-wrap">
<div class="footer-wrap">
<div class="content">
<div class="col1">
<div class='myimage-wrap'>
<div class='flower'></div>
<div class='imageframe'>
<div class="top-image">
<div id="image-wrap">
<?php
// Check if this is a post or page, if it has a thumbnail, and if it's a big one
if ( is_singular() && current_theme_supports( 'post-thumbnails' ) &&
has_post_thumbnail( $post->ID ) &&
( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) &&
$image[1] >= HEADER_IMAGE_WIDTH ) :
// Houston, we have a new header image!
echo get_the_post_thumbnail( $post->ID );
elseif ( get_header_image() ) : ?>
<img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
<?php endif; ?>
</div>
</div>
</div><!-- /imageframe -->
</div>
<div class="col1-1">
<div id="access" role="navigation">
<?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary', 'show_home' => true) ); ?>
</div>
<br />
<?php get_sidebar(); ?>
</div>
<div class="col1-2">
<div class="sidebar-footer">
<?php get_sidebar( 'right' ); ?><br />
<?php /* get_search_form(); */ ?>
</div><!-- /Sidebar footer -->
</div><!-- /col2 -->
</div><!-- /col1 -->
<div class="col2">
<div class="post">
<?php while ( have_posts() ) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class='date-tag-wrap'>
<div class='date-wrap'>
<?php /* comments_popup_link( __( 'Leave a comment', 'personaldiary' ), __( '1 Comment', 'personaldiary' ), __( '% Comments', 'personaldiary' ) ); */ ?>
<?php echo get_the_date(); ?>
</div>
<div class="tag-wrap">
<span class='post-labels'>
<?php /* printf( __( '<span class="%1$s" style="color:#fb20a4">In</span> %2$s', 'personaldiary' ), 'entry-utility-prep entry-utility-prep-cat-links', get_the_category_list( ', ' ) ); */ ?>
<?php echo get_the_time(); ?>
</span>
</div>
</div><!-- /date-tag-wrap -->
<h3 class="post-title">
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
<?php the_title(); ?>
</a>
</h3><!-- /post-title -->
<?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php else : ?>
<div class="post-body">
<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'personaldiary' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'personaldiary' ), 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<?php endif; ?>
<div class='post-footer-top'>
<div class="post-footer-bottom">
<div class="p-footer-content">
<?php
$tags_list = get_the_tag_list( '', ', ' );
if ( $tags_list ):
?>
<span class="tag-links">
<?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'personaldiary' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?>
</span>
<span class="meta-sep"><?php echo get_the_date(); ?></span>
<?php endif; ?>
<span class="comments-link"></span>
<?php edit_post_link( __( 'Edit', 'personaldiary' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
</div><!-- p-footer-content -->
<div class="p-footer-content cust-wid">
<?php if ( is_active_sidebar( 'footer-contact' ) ) : ?>
<ul id="">
<?php dynamic_sidebar( 'footer-contact' ); ?>
</ul>
<?php endif; ?>
</div><!-- p-footer-content -->
</div>
</div><!-- .entry-utility -->
</div><!-- #post-## -->
<?php comments_template( '', true ); ?>
<?php endwhile; // End the loop. Whew. ?>
<?php if ( $wp_query->max_num_pages > 1 ) : ?>
<div id="nav-below" class="navigation">
<div class="olderposts"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'personaldiary' ) ); ?></div>
<div class="newerposts"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'personaldiary' ) ); ?></div>
</div><!-- #nav-below -->
<?php endif; ?>
</div><!-- /post -->
</div>
<div style="clear:both;"></div>
</div><!-- /Content -->
</div><!-- /footer wrap -->
</div><!-- /content wrap -->
<?php get_footer(); ?>
// Related code
<?php $orig_post = $post;
global $post;
$tags = wp_get_post_tags($post->ID);
if ($tags) {
$tag_ids = array();
foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
$args= array(
'tag__in' => $tag_ids,
'post__not_in' => array($post->ID),
'posts_per_page'=>2, // Number of related posts that will be shown.
'ignore_sticky_posts'=>1
);
$my_query = new WP_Query( $args );
if( $my_query->have_posts() ) {
echo '<div id="relatedposts"><h3>Related Posts</h3>';
while( $my_query->have_posts() ) {
$my_query->the_post(); ?>
<h3><a href="<?php the_permalink()?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
<?php }
echo '</div>';
}
}
$post = $orig_post;
wp_reset_query(); ?> <?php
@Disappointed1
Copy link

I wouldn't trust this code. Please beware! This developer@mmh4560 is on other platforms and is a known hacker and has stolen data. After coming into contact with him, my website had a security breach. Use at your own risk!

[fiverr] https://user-images.githubusercontent.com/41753796/43276636-5bbdbefc-90d3-11e8-85e4-ae54fbcb713c.jpg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment