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 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. :)

How to View Current Page Sub Page only?

Hi, Below code is very nice,

<?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) {
foreach($my_pagelist as $my_child) {
$my_child_slug = $my_slug . ‘/’. $my_child->post_name.’/’;
$my_content = apply_filters(‘the_content’,$my_child->post_content);
$my_content = str_replace(‘]]>’, ‘]]>’, $my_content);
echo $my_content;
}
}
?>

This is reference site :
http://codex.wordpress.org/Function_Reference/wp_list_pages
http://wordpress.org/support/topic/display-subpage-content-on-parent-page
🙂

How to Multi Language WordPress?

WPML Pricing

Problem Log-out with WordPress ?

http://wordpress.org/support/topic/problem-log-out-with-wordpress

http://wordpress.org/support/topic/error-when-trying-to-logout/page/2

http://wordpress.org/support/topic/error-when-trying-to-logout?replies=7

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 :)

How to create wp curve menu css ?

You can use below coding that is useful for curve menu creation.

/* =Menu
————————————————————– */
#top-bar-bg{
background: #820086;
border-bottom:8px solid #000;
padding:20px 0 0 0;

}
div.search_container{
position:absolute;
top:0;
right:0;
}
div.search_container input.keywords{
font:12px Arial, Helvetica, sans-serif;
float:left;
}
#access {
display: block;
margin: 0 auto;
width: 940px;
position:relative;
}
#access .menu-header,
div.menu {
font-size: 13px;
margin-left: 12px;
width: 928px;
}
#access .menu-header ul,
div.menu ul {
list-style: none;
margin: 0;
}
#access .menu-header li,
div.menu li {
float: left;
position: relative;
}
#access a {
display: block;
line-height: 38px;
text-decoration: none;
/*-moz-border-radius-topleft:5px;
-moz-border-radius-topright:5px;*/
font:14px Arial, Helvetica, sans-serif;
padding:10px;
}
#access ul li {
color: #9D9B9B;
background:url(images/menu-normal-right.jpg) no-repeat top right;
margin-right:10px;
}
#access ul li a{
color: #9D9B9B;
background:url(images/menu-normal-left.jpg) no-repeat top left;
}

#access ul ul {
/*box-shadow: 0px 3px 3px rgba(0,0,0,0.2);
-moz-box-shadow: 0px 3px 3px rgba(0,0,0,0.2);
-webkit-box-shadow: 0px 3px 3px rgba(0,0,0,0.2);*/
display: none;
position: absolute;
top: 38px;
left: 0;
float: left;
width: 180px;
z-index: 99999;
}
#access ul ul li {
min-width: 180px;
}
#access ul ul ul {
left: 100%;
top: 0;
}
#access ul ul a {
background: #333;
line-height: 1em;
padding: 10px;
width: 160px;
height: auto;
}
#access li:hover {
background:url(images/menu-hilight-right.jpg) no-repeat top right;
color: #000;
}
#access li:hover > a,
#access ul ul :hover > a {
background:url(images/menu-hilight-left.jpg) no-repeat top left;
color: #000;
}
#access ul li:hover > ul {
display: block;
}
#access ul li.current_page_item,
#access ul li.current-menu-ancestor,
#access ul li.current-menu-item,
#access ul li.current-menu-parent {
background:url(images/menu-hilight-right.jpg) no-repeat top right;
color: #000;

}
#access ul li.current_page_item > a,
#access ul li.current-menu-ancestor > a,
#access ul li.current-menu-item > a,
#access ul li.current-menu-parent > a {
background:url(images/menu-hilight-left.jpg) no-repeat top left;
color: #000;

}
* html #access ul li.current_page_item,
* html #access ul li.current-menu-ancestor,
* html #access ul li.current-menu-item,
* html #access ul li.current-menu-parent,
* html #access ul li{
background:url(images/menu-hilight-right.jpg) no-repeat top right;
color: #000;
}
* html #access ul li.current_page_item a,
* html #access ul li.current-menu-ancestor a,
* html #access ul li.current-menu-item a,
* html #access ul li.current-menu-parent a,
* html #access ul li a:hover {
background:url(images/menu-hilight-left.jpg) no-repeat top left;
color: #000;
}

that’s all. 🙂

Other one Option :

/* =Menu
————————————————————– */

#access {
display: block;
float: left;
margin: 0 auto 0 auto;
width: 500px;
height:29px;
position:absolute;
top:39px;
right:0px;
}
#access .menu-header,
#access .menu-header ul.menu {
font:12px “Myriad Pro”, Arial, Helvetica, sans-serif, Verdana;
color:#9CB2E4;
margin-left: 12px;
width: 420px;
float:right;
}
#access .menu-header ul,
#access .menu-header ul.menu ul {
list-style: none;
margin: 0;
}
#access .menu-header li,
#access .menu-header ul.menu li {
float: left;
position: relative;
padding:0 0 0 0;
}
#access .menu-header a {
color:#9CB2E4;
font:bold 12px “Trebuchet MS”, Arial, Helvetica, sans-serif;
text-decoration:none;
padding:13px 0 13px 0;
text-decoration: none;
background: url(images/topmenuright.gif) no-repeat right;
}
#access .menu-header ul li a span { padding:13px 15px; background: url(images/topmenuleft.gif) no-repeat left;}
#access .menu-header ul ul {
box-shadow: 0px 3px 3px rgba(0,0,0,0.2);
-moz-box-shadow: 0px 3px 3px rgba(0,0,0,0.2);
-webkit-box-shadow: 0px 3px 3px rgba(0,0,0,0.2);
display: none;
position: absolute;
top: 38px;
left: 0;
float: left;
width: 180px;
z-index: 99999;
}
#access .menu-header ul li a{
margin:0 5px;
float:left;
}
#access .menu-header ul ul li {
min-width: 180px;
padding:13px 10px;
}
#access .menu-header ul ul ul {
left: 100%;
top: 0;
}
#access .menu-header ul ul a {
/*background: transparent;*/
line-height: 1em;
padding: 15px;
width: 160px;
height: auto;
}
#access .menu-header li:hover > a,
#access .menu-header ul ul :hover > a {

color:#fff; background: url(images/topmenurighthover.gif) no-repeat right;
}
#access .menu-header li:hover > a span,
#access .menu-header ul ul :hover > a span{color:#fff; background:url(images/topmenulefthover.gif) no-repeat left; }

#access .menu-header ul li:hover > ul {
display: block;
}
#access .menu-header ul li.current_page_item > a,
#access .menu-header ul li.current-menu-ancestor > a,
#access .menu-header ul li.current-menu-item > a,
#access .menu-header ul li.current-menu-parent > a {
color:#fff; background:url(images/topmenurighthover.gif) no-repeat right;
}
#access .menu-header ul li.current_page_item > a span,
#access .menu-header ul li.current-menu-ancestor > a span,
#access .menu-header ul li.current-menu-item > a span,
#access .menu-header ul li.current-menu-parent > a span{
color:#fff; background:url(images/topmenulefthover.gif) no-repeat left; }

* html #access .menu-header ul li.current_page_item a,
* html #access .menu-header ul li.current-menu-ancestor a,
* html #access .menu-header ul li.current-menu-item a,
* html #access .menu-header ul li.current-menu-parent a,
* html #access .menu-header ul li a:hover {
color:#fff; background:url(images/topmenurighthover.gif) no-repeat right;
}
* html #access .menu-header ul li.current_page_item a span { color:#fff; background:url(images/topmenulefthover.gif) no-repeat left; }

Rss Feed Link in WP

URL for RDF/RSS 1.0 feed
<?php bloginfo('rdf_url'); ?>
URL for RSS 0.92 feed
<?php bloginfo('rss_url'); ?>
URL for RSS 2.0 feed
<?php bloginfo('rss2_url'); ?>
URL for Atom feed
<?php bloginfo('atom_url'); ?>
URL for comments RSS 2.0 feed
<?php bloginfo('comments_rss2_url'); ?>

http://codex.wordpress.org/WordPress_Feeds

Wp calender Stamp

function calendar (){ ?>
<div>
<div><?php the_time(‘M’) ?></div>
<div><?php the_time(‘j’) ?></div>
<div><?php //the_time(‘Y’) ?></div>
</div>
<?php
}
//add_action(‘thesis_hook_before_headline’, ‘calendar’);

/*** calendaricon ***/
.calendaricon{
background:url(images/date-stamp-bg.jpg) no-repeat top left;
position:relative;
width:45px;
height:49px;
float:left;
margin-right:10px;
}
.month{
position:absolute;
font:11px Arial, Helvetica, sans-serif;
color:#FFFFFF;
text-align:center;
width:100%;
top:4px;
}
.day{
position:absolute;
font:bold 19px Georgia, “Times New Roman”, Times, serif;
color:#000000;
text-align:center;
width:100%;
top:20px;
}
/*** calendaricon ***/

WP Menu Path

wp-includes/nav-menu-template.php
wp-includes/post-template.php

<ul>
<?php wp_list_pages('title_li='); ?>
</ul>


<ul>
  <?php wp_list_pages('include=5,9,23&title_li=<h2>' . __('Poetry') . '</h2>' ); ?>
</ul>


<ul>
  <?php wp_list_pages('sort_column=menu_order'); ?>
</ul>


<ul>
  <?php wp_list_pages('sort_column=menu_order&title_li=<h2>' . __('Prose') . '</h2>' ); ?>
</ul>


<ul>
  <?php wp_list_pages('sort_column=menu_order&title_li='); ?>
</ul>


<ul>
  <?php wp_list_pages('sort_column=post_date&show_date=created'); ?>
</ul>


<ul>
  <?php wp_list_pages('exclude=17,38' ); ?>
</ul>


<ul>
  <?php wp_list_pages('include=7,13,26,35&title_li=<h2>' . __('Pages') . '</h2>' ); ?>
  </ul>


<ul>
  <?php
  global $id;
  wp_list_pages("title_li=&child_of=$id&show_date=modified
  &date_format=$date_format"); ?>
</ul>
© 2020 Spirituality