Archive for the ‘Wordpress’ Category

<?php
global $wp_query;
$postid = $wp_query->post->ID;
echo get_post_meta($postid, 'Your-Custom-Field', true);
wp_reset_query();
?>

<?php $admin_email = get_option(‘admin_email’); ?>  Admin Email

<?php echo get_option(‘blogname’); ?>

 

<?php

 $querystr = "
    SELECT $wpdb->posts.* 
    FROM $wpdb->posts, $wpdb->postmeta
    WHERE $wpdb->posts.ID = $wpdb->postmeta.post_id 
    AND $wpdb->postmeta.meta_key = 'tag' 
    AND $wpdb->postmeta.meta_value = 'email' 
    AND $wpdb->posts.post_status = 'publish' 
    AND $wpdb->posts.post_type = 'post'
    AND $wpdb->posts.post_date < NOW()
    ORDER BY $wpdb->posts.post_date DESC
 ";

 $pageposts = $wpdb->get_results($querystr, OBJECT);

 ?>
<?php if ($pageposts): ?>
 <?php global $post; ?>
 <?php foreach ($pageposts as $post): ?>
 <?php setup_postdata($post); ?>

 <div id="post-<?php the_ID(); ?>">
 <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
    <?php the_title(); ?></a></h2>
    <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>
    <div>
       <?php the_content('Read the rest of this entry »'); ?>
    </div>
    <p>Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?>  
    <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
 </div>
 <?php endforeach; ?>
 <?php else : ?>
    <h2>Not Found</h2>
    <p>Sorry, but you are looking for something that isn't here.</p>
    <?php include (TEMPLATEPATH . "/searchform.php"); ?>
 <?php endif; ?>

Line 13 – 16 in content.php of the twentyeleven theme. Line 16 places the word Featured on sticky posts.

13 <?php if ( is_sticky() ) : ?>
14 ........
15 .........
16 <h3><?php _e( 'Featured', 'twentyeleven' ); ?></h3>

open function.php

register_sidebar( array(
‘name’ => __( ‘Copyright’, ‘twentyeleven’ ),
‘id’ => ‘sidebar-4’,
‘description’ => __( ‘An optional widget area for your site footer’, ‘twentyeleven’ ),
‘before_widget’ => ‘<aside id=”%1$s”>’,
‘after_widget’ => “</aside>”,
‘before_title’ => ‘<h3>’,
‘after_title’ => ‘</h3>’,
) );

register_sidebar( array(
‘name’ => __( ‘Copyright’, ‘twentyeleven’ ),
‘id’ => ‘sidebar-4’,
‘description’ => __( ‘An optional widget area for your site footer’, ‘twentyeleven’ ),
‘before_widget’ => ”,
‘after_widget’ => “”,
‘before_title’ => ”,
‘after_title’ => ”,
) );