How to view in Catgory Name wise Recent Post view in WP?

You can add below code where you want in your php file inside :
<?php query_posts(‘category_name=pre-work-out&showposts=10’); ?>
<?php while (have_posts()) : the_post(); ?>
<h3><a href=”<?php echo get_permalink($page->ID); ?>”><?php the_title(); ?></a></h3>
<?php the_excerpt(); ?>
<?php endwhile;?>

This is show what you like in your recent post from your specific category wise. What you like change you “query_post” inside.

How to add “Shortcode” for WP Contact Form 7?

1. Example :

Copy this code and paste it into your post, page or text widget content.
[contact-form-7 404 "Not Found"]

2. Example

Copy Below code in your php file inside where you want put this:
<?php echo do_shortcode( ‘[contact-form-7 404 "Not Found"]‘ ); ?>

How to write first php code?

This is very easy. Just write below code in your php file.

<?php

echo “Welcome New Php Reader”;

?>

Then refersh your server or localhost. There showing  Welcome New Php Reader.

How to Create Php info Page?

Hi, its very easy to create.
1. Just put below code in php file inside

<?php
echo phpinfo();
?>

2. Save file phpinfo.php
3. Upload your server or localhost
4. Run yourdomain/phpinfo.php
5. It’s show your “php info” results.

Allways happy. 🙂

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" />';
}
?>




© 2020 Spirituality