<?php $current_category = single_cat_title(“”, false);
echo $current_category;
?>
<?php $current_category = single_cat_title(“”, false);
echo $current_category;
?>
<?php if(preg_match('/(?i)msie [1-8]/',$_SERVER['HTTP_USER_AGENT']))
{
// if IE<=8
include ( TEMPLATEPATH . '/noie.php' );
exit;
}
else
{
// if IE>8
} ?>
<?php
global $post;
$args = array(
‘show_option_all’ => ”,
‘orderby’ => ‘name’,
‘order’ => ‘ASC’,
‘style’ => ‘list’,
‘show_count’ => 0,
‘hide_empty’ => 1,
‘use_desc_for_title’ => 1,
‘child_of’ => 0,
‘feed’ => ”,
‘feed_type’ => ”,
‘feed_image’ => ”,
‘exclude’ => ”,
‘exclude_tree’ => ”,
‘include’ => ”,
‘hierarchical’ => 1,
‘title_li’ => __( ‘Categories’ ),
‘show_option_none’ => __(‘No categories’),
‘number’ => null,
‘echo’ => 1,
‘depth’ => 0,
‘current_category’ => 0,
‘pad_counts’ => 0,
‘taxonomy’ => ‘product_cat’,
‘walker’ => null ); ?>
<?php $catTerms = get_terms(‘product_cat’, array(‘hide_empty’ => 0, ‘orderby’ => ‘ASC’)); ?>
<?php foreach($catTerms as $catTerm) : ?>
<a href=”?product_cat=<?php echo $catTerm->slug; ?>”><?php echo $catTerm->name; ?></a><br/>
<?php echo $catTerm->description ; ?>
<?php
$thumbnail_id = get_woocommerce_term_meta( $catTerm->term_id, ‘thumbnail_id’, true );
// get the image URL
$image = wp_get_attachment_url( $thumbnail_id );
// print the IMG HTML
echo ‘<img src=”‘.$image.'” alt=”” width=”300″ height=”208″ />’; ?>
<?php echo $catTerm->term_id;?>
<?php endforeach; ?>
Write below code line before this <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> line
to exclude unwanted posts categories in
<?php query_posts($query_string . ‘&cat=-4,-5,-11,-12,-13,-16’); ?>
<?php
$category = get_queried_object();
echo $category->term_id; ?>
<?php
include_once(ABSPATH.WPINC.'/rss.php'); // path to include script
$feed = fetch_rss('http://domain.tld/your-feed/'); // specify feed url
$items = array_slice($feed->items, 0, 7); // specify first and last item
?>
<?php if (!empty($items)) : ?>
<?php foreach ($items as $item) : ?>
<h2><a href="<?php echo $item['link']; ?>"><?php echo $item['title']; ?></a></h2>
<p><?php echo $item['description']; ?></p>
<?php endforeach; ?>
<?php endif; ?>
Some useful variables:
$item[‘link’] – post permalink
$item[‘title’] – title of the post
$item[‘pubdate’] – post publication date
$item[‘description’] – post excerpt or content
$item[‘creator’] – post author
$item[‘content’] – post content