How to create future OR Post Thumbnail in WP?

Go to function.php file, Insert Below Code :

// Post thumbnail OR futured Image Set
add_theme_support( ‘post-thumbnails’ );
set_post_thumbnail_size(100, 100, true);

And add below code which you want show the future Image :

<?php the_post_thumbnail(); ?>


Additional Option :

Go to function.php file, Insert Below Code :

add_image_size('loopThumb', 588, 125, true);

OR
<?php the_post_thumbnail('loopThumb', array('class'=>'loopyThumbs')); ?>
OR
add_image_size('squareThumb', 125, 125, true);

OR

if (function_exists('add_theme_support')) {
add_theme_support('post-thumbnails');
set_post_thumbnail_size(588, 250, true); // Normal post thumbnails
add_image_size('loopThumb', 588, 125, true);
}
OR
<?php add_theme_support('post-thumbnails', array('page')); ?>

And add below code which you want show the future Image :

<?php the_post_thumbnail('loopThumb'); ?>

OR

<?php the_post_thumbnail('squareThumb'); ?>
OR
<?php the_post_thumbnail('loopThumb'); ?>
OR
<?php
if (has_post_thumbnail()) {
the_post_thumbnail('loopThumb');
}
elseif (get_post_meta($post->ID, "Thumbnail", true) != '') { ?>
<img src="<?php echo get_post_meta($post->ID, "Thumbnail", true); ?>" alt="<?php the_title(); ?>" class="attachment-loopThumb wp-post-image" />
<?php }
else {
echo '<img src="images/defaultThumbnail.png" alt="Default Post Image" />';
}
?>




How to Get Custome Page Id view in Query?

<?php
// All Categorie Lagest Post Code
$the_query = new WP_Query( ‘page_id=14’ );
// The Loop
while ( $the_query->have_posts() ) : $the_query->the_post();
?>
<div>
<?php //the_date(); ?>
<div>
<?php //echo get_the_post_thumbnail($page->ID, ‘thumbnail’);
echo get_the_post_thumbnail($page->ID, ‘full’);
?>
</div>
<h2><a href=”<?php echo get_permalink($page->ID); ?>”><?php the_title(); ?></a></h3>

<?php the_excerpt(); ?>
</div>
<?php
endwhile;

// Reset Post Data
wp_reset_postdata();
?>

How to get the different categories Latest Article in one Page?

<div>LATEST ARTICLES</div>
<?php
$args = array( ‘orderby’ => ‘date’, ‘numberposts’ => 3, ‘order’=> ‘DESC’ );
$postslist = get_posts( $args );
foreach ($postslist as $post) :  setup_postdata($post); ?>
<div>
<?php //the_date(); ?>
<div>
<?php //echo get_the_post_thumbnail($page->ID, ‘thumbnail’);
echo get_the_post_thumbnail($page->ID, ‘full’);
?>
</div>
<h3><a href=”<?php echo get_permalink($page->ID); ?>”><?php the_title(); ?></a></h3>

<?php
// Get the categories
$category = get_the_category();

// Get the 3 Latest Article
$string = get_category_link( $category[0]->cat_ID );
?>
<h4><a href=”<?php echo str_replace(‘category/’, ”, $string ); ?>”><?php echo $category[0]->cat_name; ?></a></h4>
<?php the_excerpt(); ?>
</div>
<?php endforeach; ?>

© 2020 Spirituality