How to create 3 column or Row Latest Post Via WP?

Hi,

Below code useful for all this is very nice one in WordPress.
<div>
<h2>Latest News</h2>
<?php
//$args = array(‘orderby’ => ‘date’, ‘numberposts’ => 3, ‘category’ => 6, ‘order’=> ‘DESC’); //This Categories wise latest post display
$args = array(‘orderby’ => ‘date’, ‘numberposts’ => 3, ‘order’=> ‘DESC’); // This all post display
$postslist = get_posts( $args );
$i; //This is counting the iteam purpose using
foreach ($postslist as $post) :  setup_postdata($post);
$i++; // This is increasing howmany foreach going that is purpose using.
?>
<div>
<h2><a href=”<?php echo get_permalink($page->ID); ?>”><?php the_title(); ?></a></h2>
<?php //the_date(); ?>
<?php //echo get_the_post_thumbnail($page->ID, ‘thumbnail’);?>
<?php echo get_the_post_thumbnail($page->ID, ‘full’); ?>
<?php the_excerpt(); ?>
</div>
<?php endforeach; ?>
</div><!– Latest News Container End –>

How to view All Categories only in Home from Magento?

<?php $_maincategorylisting=$this->getCurrentCategory()?>
<?php $_categories=$this->getCurrentChildCategories()?>
<!– h2><?php //echo $this->__(‘Browse Products’) ?> </h2 –>
<div>
<ul>
<? foreach ($_categories as $_category):?>
<? if($_category->getIsActive()): ?>
<?php $cur_category=Mage::getModel(‘catalog/category’)->load($_category->getId()); ?>
<?php $layer = Mage::getSingleton(‘catalog/layer’); ?>
<?php $layer->setCurrentCategory($cur_category);
//$this->getCurrentCategory()->getImageUrl()
?>
<? if($_imageUrl=$this->getCurrentCategory()->getThumbnailUrl()):?>
<li> <a href=”<?php echo $this->getCategoryUrl($_category) ?>” title=”<?php echo $this->htmlEscape($_category->getName()) ?>”>
<img src=”<?php echo $_imageUrl ?>” width=”auto” alt=”<?php echo $this->htmlEscape($_category->getName()) ?>” />
</a>
<a href=”<?php echo $this->getCategoryUrl($_category) ?>” title=”<?php echo $this->htmlEscape($_category->getName()) ?>”>
<?php echo $this->htmlEscape($_category->getName()) ?>
</a>
<? if($_description=$this->getCurrentCategory()->getDescription()):?>
<p>
<?php echo $_description ?></p></li>
<?php endif; ?>
<? endif; ?>
<? endif; ?>
<?php endforeach; ?>
<div></div>
</ul>
<div></div>
</div>
<?php $layer->setCurrentCategory($_maincategorylisting); ?>

Just Put your home page or Any Static Page this below Line only :

{{block type=”catalog/navigation” name=”catalog.categories” alias=”all_categories_homepage” template=”catalog/navigation/all_category_view.phtml”}}

Welcome to our other site : www.srinesiga.com

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 Display Post in Categories Wise in WP?

<div>LATEST ARTICLES</div>
<?php
$args = array(‘orderby’ => ‘date’, ‘numberposts’ => 3, ‘category’ => 6, ‘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 the_excerpt(); ?>
</div>
<?php endforeach; ?>
<div></div>

<?php
// All Categorie Lagest Post Code
$the_query = new WP_Query( ‘cat=6&posts_per_page=10&offset=3’ );
// 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>
<h3><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();
?>
<div></div>
<?php
// Get Categorie Slug Name
function get_cat_slug($cat_id) {
$cat_id = (int) $cat_id;
$category = &get_category($cat_id);
return $category->slug;
}
?>
<?php
// Get the categories
$category = get_the_category();

// Get the 3 Latest Article
$string = get_category_link( $category[0]->cat_ID );
//        echo $string;
?>
<div><a href=”http://www.anotherway.org/category/<?php echo get_cat_slug(6); ?>”>View All Save Your Health</a></div>

How to get Categories Slug Name?

<?php
// Get Categorie Slug Name
function get_cat_slug($cat_id) {
$cat_id = (int) $cat_id;
$category = &get_category($cat_id);
return $category->slug;
}
?>

<div><a href=”http://www.yourdomain.com/category/<?php echo get_cat_slug(8); ?>”>View All</a></div>

that’s all. 🙂

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; ?>

How Create Categorie Resent Post?

Display 5 latest posts in each category in WordPress


http://blogsessive.com/blogging-tools/latest-posts-by-category-archive/

Display 10 recent post titles on homepage

http://codex.wordpress.org/Function_Reference/in_category
<strong>http://codex.wordpress.org/Function_Reference/get_the_category</strong>
<div>LATEST ARTICLES</div>
$args = array(‘orderby’ => ‘name’, ‘numberposts’ =>3, ‘category’ => 3, ‘order’=> ‘ASC’, ‘orderby’ => ‘title’ );
$postslist = get_posts( $args );
foreach ($postslist as $post) :  setup_postdata($post); ?>
<div>
<div>ID, ‘thumbnail’);
echo get_the_post_thumbnail($page->ID, ‘full’);
?></div>
$category = get_the_category();

$category_id = get_cat_ID(‘3′);
// Get the URL of this category
$category_link = get_category_link($category_id);
//echo $category[3]->cat_name; ?>
<h4>cat_name.'”>’.$category[3]->cat_name.”; ?></h4>
</div>
that’s all :)

© 2020 Spirituality