Skip to content

Instantly share code, notes, and snippets.

View yevhenkobzar's full-sized avatar

Eugene yevhenkobzar

View GitHub Profile
<?php
$idObj = get_category_by_slug('s_about');
$id = $idObj->term_id;
echo get_cat_name($id);
?>
<?php
$tags = get_tags();
if ($tags) {
foreach ($tags as $tag) {
echo '<p>Tag: <a href="' . get_tag_link( $tag->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $tag->name ) . '" ' . '>' . $tag->name.'</a> </p> ';
}
}
?>
<?php
$tags = wp_get_post_tags($post->ID);
<?php echo get_post_meta($post->ID, 'year', true); ?>
@yevhenkobzar
yevhenkobzar / post-thumbnail.html
Created June 5, 2017 07:39 — forked from agragregra/post-thumbnail.html
WordPress Post Thumbnail URL
<?php $url = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'large' ); $url = $url['0']; ?>
<?php if ( have_posts() ) : query_posts('p=1');
while (have_posts()) : the_post(); ?>
<?php the_title(); ?>
<?php the_content(); ?>
<?php the_post_thumbnail(array(100, 100)); ?>
<? endwhile; endif; wp_reset_query(); ?>