<?php $links = get_bookmarks( array(
'orderby' => 'link_id',
'order' => 'ASC',
));
//print_r($links);
// Loop through each bookmark and display the formatted output
foreach ( $links as $link ) {
echo '<li>';
echo '<strong>'.$link->link_name.'</strong>';
echo '<br />';
echo '<a href="'.$link->link_url.'" target="_blank">';
echo $link->link_url.'</a>';
echo '<br />';
echo $link->link_description;
echo '</li>';
} ?>
Wednesday, November 28, 2012
use the get_bookmarks() method
Wednesday, November 21, 2012
display all Authors in an unordered list
$args = array( 'blog_id' => $GLOBALS['blog_id'], 'role' => 'Author', 'orderby' => 'nicename' ); $blogusers = get_users($args); // print_r($blogusers); foreach ($blogusers as $user) { echo '' . $user->user_email . ''; }
Sunday, November 18, 2012
meta_query with comparison
Display posts of type 'my_custom_post_type', ordered by 'training_date', and filtered
<?php
$todaysDate = date( 'd-m-Y' );
$args = array(
'post_type' => 'training',
'meta_key' => 'training_date',
'orderby' => 'training_date',
'order' => 'ASC',
'meta_query' => array(
array(
'key' => 'training_date',
'value' => $todaysDate,
'compare' => '>=',
))
);
$query = new WP_Query($args);
Tuesday, November 13, 2012
How to hide Personal Options in WordPress’ User Profile
Adding this code to the functions.php of your wordpress theme
function hide_personal_options() {
?>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery("#your-profile .form-table:first, #your-profile h3:first").remove();
});
</script>
<?php
}
add_action( 'personal_options', 'hide_personal_options');
Subscribe to:
Posts (Atom)