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 Creating dynamic table in PHP?

<?php
echo ‘
<table border=”1″ width=”50%”>
<tbody>
<tr>’;
$content = array(1, 2, 3, 4, 5, 6, 7, 8, 9);
$counter = 0;
foreach($content as $data) {
if($counter != 0 && $counter%3 == 0) {
echo “</tr>
<tr>”;
}
echo ”
<td>”;
echo $data;
echo “</td>
“;
$counter++;
}
echo ‘</tr>
</tbody>
</table>
‘;
?>
<table border=”0″ cellspacing=”0″ cellpadding=”0″>
<tbody>
<tr>
<?php
$args = array(
‘numberposts’ => -1,
‘post_parent’ => $post->ID,
‘post_type’ => ‘page’,
‘post_status’ => ‘publish’,
‘orderby’ => ‘menu_order,title’,
‘order’ => ‘ASC’
);
$my_pagelist = &get_children($args);

if ($my_pagelist) {
//                  echo count($my_pagelist);
//echo get_the_post_thumbnail($my_child->ID, ‘thumbnail’, array(‘class’ => ‘ourservices-thumb’));
//echo get_the_post_thumbnail($my_child->ID, ‘medium’, array(‘class’ => ‘ourservices-thumb’));
//echo get_the_post_thumbnail($my_child->ID, ‘full’, array(‘class’ => ‘ourservices-thumb’));
//echo sizeof($my_child).” – “.count($my_child);
//                $count = count($my_child);
$counter = 0;
foreach($my_pagelist as $my_child) {
$my_child_slug = $my_slug . ‘/’. $my_child->post_name.’/’;
if($counter != 0 && $counter%3 == 0) {
echo “</tr>
<tr>”;
}
echo ‘
<td>’;
echo get_the_post_thumbnail($my_child->ID, array(200,120), array(‘class’ => ‘ourservices-thumb’)).’
<h3><a href=”‘.$my_child_slug.'”>”‘.$my_child->post_title.'”</a></h3>
‘;
echo ‘</td>
‘;
$counter++;
}

}
?></tr>
</tbody>
</table>
enjoy just for fun: This is easy for coding guys.
other guys is very diffcult. I am searching more things in google. then i found the solution for this. Thanks for all google users.

That’s all. :)

© 2020 Spirituality