Support

Wordpress Tips (38 posts)

  1. rss milo

    moderator


    rss Posted 4 years ago
    #

    Easy socializing for WordPress themes:
    follow the instructions here or read the README file.

    Install:

    • 1. Unpack this archive on your HD.
    • 2. Open it and look for the style.css and social.php.
    • 3. Adjust the css your current theme
      e.g. background colors, font colors and so on in styles.css.
    • 4. Adjust the image call som it compliments your current theme
      e.g. path to your image folder : url ( images/digg.gif ) or url ( img/digg.gif ) and so on to match your current theme.
    • 5. Upload the social template to your current themes folder, the images to the themes image folder.
    • 6. Open your home.php, index.php and single.php, where you want to place the php call.
      Best place to integrate would be after the tags call under each wp post call.

      with this php call:

    • < ? php include ( TEMPLATEPATH. " / social.php " ) ; ? >

    • 7. REMOVE THE SPACES BEFORE PLACING IT
    • 8. Cut and paste the css into your themes stylesheet.
    • 9. You're done, have fun.

    Customization:

    • - Alignment classes: by default all images are left aligned, change this line to uncover it:
      ...no-repeat left center...

    Download

  2. rss milo

    moderator


    rss Posted 4 years ago
    #

    Toggle Stylesheets:

    Download this js file

    Upload the style swich file to your themes js folder

    Copy your basic theme stylesheet and rename it to style2
    Insert the js call in your header:
    < script src = " < ? php bloginfo ( ' stylesheet _ directory ' ) ; ? / js / style-switch . js " type = " text / javascript " > < / script >
    REMOVE THE SPACES
    Insert the two stylesheet calls in your header:
    < link rel = " stylesheet " href = " < ? php bloginfo ( ' stylesheet _ url ' ) ; ? > " type = " text / css " title = " default " media = " screen " / >
    < link rel = " alternate stylesheet " type = " text / css " media = " screen " title = " style2 " href = " < ? php bloginfo ( ' stylesheet _ directory ' ) ; ? > / style2 . css " / >
    REMOVE THE SPACES

    Note the difference between the title "default" for your basic stylesheet and the second title "style2".
    Vary your basic stylesheet by applying new rules to the id's and classes.

    Upload new images to your themes image folder (if needed)
    Insert the script call at an appropriate place:
    Styles: < a rel = " no follow " title = " Toggle stylesheets " href = " javascript : chooseStyle ( ' none ' , % 20 60 ) " > # 000 < / a> | < a rel = " no follow " title = " Toggle stylesheets " href = " javascript : chooseStyle ( ' style2 ' , % 20 60 ) " > # fff < / a >

  3. rss milo

    moderator


    rss Posted 4 years ago
    #

    DO NOT download any of my themes from unknown sites, use my themes page or the WordPress theme viewer.

    In particular DO NOT download the themes from easyblogthemes.
    Reason: easyblogthemes added php codes with unvisible ads in ALL themes.

  4. rss milo

    moderator


    rss Posted 4 years ago
    #

    In order to use them, you will first need to install the Greasemonkey Extension in your Firefox Web Browser.
    WordPress Greasemonkey Scripts

  5. rss milo

    moderator


    rss Posted 4 years ago
    #

    Add Gravatars WITHOUT a plugin:
    Open your comments template and find this line:
    < ? php echo $ oddcomment ; ? > " id = " comment - < ? php comment _ ID ( ) ? >
    Cut and paste this without spaces:
    < ? php

    if ( ! empty ( $ comment -> comment _ author _ email ) ) {

    $ md5 = md5 ( $comment -> comment _ author _ email );

    $ default = urlencode( 'PATH to default image' );

    echo " < img style = ' STYLE IT ; ' src = ' http : // www . gravatar . com / avatar.php ? gravatar _ id = $ md5 & size= 20 & default = $ default' alt = '' / > " ;

    }

    ?>
    Or download an example.

  6. rss milo

    moderator


    rss Posted 4 years ago
    #

    Setting up a WordPress sideblog WITHOUT a plugin:
    Set up yur desired category or choose a current one.
    Add the following code to your functions php file:
    < ? php
    function asidesFilter ( $ query ) {
    if ( $ query - > is_feed | | $ query - > is _ home | | $ query - > is _ search ) {
    $ query - > set( ' cat ' , ' - 17 ' ) ;
    }
    return $ query ;
    }
    add _ filter ( ' pre _ get _ posts ' , ' asidesFilter ' ) ;
    ? >

    Add the following code to your sidebar, assuming you do not work with widgets:

    <h3>TITLE
    < a href = " FEED URL " title = " The Asides RSS feed . " >
    < img src = " RSS IMAGE URL " alt = " RSS " style = " position : relative ; left : 0 ; " / > < / a > < / h 3 >
    < ? php query _ posts ( ' cat = 17 & showposts = 4 ' ) ; ? >
    < ? php if ( have _ posts ( ) ) : ? >
    < ? php while ( have _ posts ( ) ) : the _ post ( ) ; ? >
    < div class = " aside _ post " >
    < ? php the _ content ( ' Continue reading this article » ' ) ; ? >

    < / div >

    < ? php endwhile ; ? >
    < span class = " aside _ archive _ link " > Archives » < / a > < / span >
    < ? php else : ? > < p > Sorry , the sideblog is having a little trouble . < / p >
    < ? php endif ; ? >

    Without obligate spaces.
    Further info at ProBlogDesign.

  7. rss milo

    moderator


    rss Posted 4 years ago
    #

    Block Search robots from your archive page by preventing the indexing:
    < ? php if ( is _ archive ( ) ) { ? > < meta name = " robots " content = " noindex " >< ? php } ? >
    Paste it anywhere in the header of your current theme BEFORE the closing of the head tag.

  8. rss milo

    moderator


    rss Posted 4 years ago
    #

    Template tags: Category:Template_Tags
    The Loop: Extended
    More Loops: Extended
    Category tags: Style your cat
    Exclude categories: How to
    htaccess for WordPress: How to write it
    htaccess for WordPress for IIS servers: How to write it

  9. rss milo

    moderator


    rss Posted 4 years ago
    #

    Block Search robots from your archive page by preventing the indexing:

    < ? php if ( is _ archive ( ) ) { ? > < meta name = " robots " content = " noindex " >< ? php } ? >
    Paste it anywhere in the header of your current theme BEFORE the closing of the head tag.`

  10. rss milo

    moderator


    rss Posted 4 years ago
    #

    Customizing the read more link text:

    1.
    Open your index php or home php file and find this line:
    <?php the_content(__('Read more'));?>

    2.
    replace it with this one:
    <?php the_content("Continue reading " . the_title('','',false),
    0); ?>

    This will change your more links to include the post title.

  11. rss milo

    moderator


    rss Posted 4 years ago
    #

    Customize the comment link:
    1.
    Open your index php, archive php or home php file and find this line:
    <?php comments_popup_link('Leave a Comment', '1 Comment', '% Comments'); ?>

    2.
    replace it with this one:
    <?php comments_popup_link(__('No comments on ' . the_title('','',false)), __('One comment on ' . the_title('','',false)), __('% comments on '. the_title('','',false))); ?>
    Of course customizing the No comments txt and further is ok too.

  12. rss milo

    moderator


    rss Posted 4 years ago
    #

    Customize the WordPress Login WITHOUT a plugin:
    1.
    Download from /wp-admin/images/ these two images:
    login-bkg-tile.gif
    login-bkg.bottom.gif
    2.
    Create two new images with SAME width and height
    3.
    Save them with the same name and file extension (*.gif)
    4.
    Upload it to the /wp-admin/images/ folder

    Of course you can use other extensions, but then you have to edit the admin.css too to match it.

  13. rss milo

    moderator


    rss Posted 4 years ago
    #

    Customize the WordPress admin WITHOUT a plugin:
    1.
    Download from /wp-admin/ this css file:
    wp-admin.css
    2.
    admin link colours, find this line:
    a {
    border-bottom: 1px solid #69c;
    color: #00019b;
    text-decoration: none;
    }
    Adjust colour to your linkings

    3.
    admin link colours, find this line:
    a.edit:hover {
    background: #ccc;
    color: #036;
    }

    a:visited {
    color: #006;
    }

    a:hover {
    /* border-bottom: 1px solid #3a75ae;*/
    color: #069;
    }
    Adjust colour to your linkings

    4.
    Don't like Lucida Grande with serifs, adjust this:
    body, td {
    font: 13px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana;
    }

    5.
    Admin top header background:
    #adminmenu {
    background: #6da6d1;
    border-top: 3px solid #448abd;
    margin: 0;
    padding: .2em .2em .2em 2em;
    }
    #adminmenu a {
    color: #000;
    font-size: 14px;
    font-weight: normal;
    margin: 0;
    padding: 3px 5px;
    text-decoration: none;
    }

    #adminmenu a:hover, .current {
    background: #ddeaf4;
    color: #333;
    }
    Adjust colour to your likings.

    6.
    Admin second level header background:
    #submenu {
    background: #0d324f;
    border-bottom: none;
    margin: 0;
    padding: 3px 2em 0 3em;
    }

    #submenu .current {
    background: #f9fcfe;
    border-top: 1px solid #045290;
    border-right: 2px solid #045290;
    color: #000;
    }

    #submenu a {
    border: none;
    color: #fff;
    font-size: 12px;
    padding: .3em .4em .33em;
    }

    #submenu a:hover {
    background: #ddeaf4;
    color: #393939;
    }
    Adjust colour to your likings.

    7.
    This is just a rough guide for changing link, background colours,
    no margins or padding were touched, however if you're finished
    your wp admin can look like this:
    Screenshot

  14. rss milo

    moderator


    rss Posted 3 years ago
    #

    Add Twitter stream to your Wordpress site without a plugin, just by using the native WP RSS support:

    <?php require_once (ABSPATH . WPINC . ‘/rss-functions.php’); ?>
    <?php $today = current_time(’mysql’, 1); ?>

    <?php
    $rss = @fetch_rss(’http://twitter.com/statuses/user_timeline/1487781.rss’);
    if ( isset($rss->items) && 0 != count($rss->items) ) {
    ?>

    <?php
    $rss->items = array_slice($rss->items, 0, 1);
    foreach ($rss->items as $item ) {
    ?>

    < a href = ’<?php echo wp_filter_kses($item[’link’]); ?>’>
    <?php echo wp_specialchars($item[’title’]); ?>
    <small>—
    <?php echo human_time_diff( strtotime($item[’pubdate’], time() ) ); ?><?php _e(’ago’); ?></small>

    <?php
    }
    }
    ?>

    Just replace
    fetch_rss(’http://twitter.com/statuses/user_timeline/1487781.rss’)
    with your Twitter RSS Feed.

  15. rss milo

    moderator


    rss Posted 3 years ago
    #

    Exclude categories:

    Dump this code anywhere in theme functions.php.

    function myFilter($query) {
    if ($query->is_feed) {
    $query->set('cat','-5');
    }

    return $query;
    }

    add_filter('pre_get_posts','myFilter');

    The category ID for Shortnotes is 5. You can find the category ID from Admin Panel → Manage → Categories. If you want to exclude multiple categories, simply add a comma (,) and a dash (-) followed by the category ID e.g '-5,-6,-7'.

  16. rss milo

    moderator


    rss Posted 3 years ago
    #

    Custom Fields

    Custom field allows you to attach data to the post with excerpts.
    Add the Custom Field in the post.
    To display the article image and attach it with the post link, place this code in The Loop:

    <?php //get article_image (custom field) ?> <?php $image = get_post_meta($post->ID, 'article_image', true); ?> < a href= "<?php the_permalink() ?>">" alt="<?php the_title(); ?>" />

  17. rss milo

    moderator


    rss Posted 3 years ago
    #

    Adding the Post Authors Gravatar To Their Individual Posts

    <?php echo get_avatar( get_the_author_email(), '50' ); ?>

    within then loop and size 50 pixel

  18. rss milo

    moderator


    rss Posted 3 years ago
    #

    WordPress Search Results Unlimited

    Find this line in your search template:

    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>

    replace with this one:

    <?php $posts=query_posts($query_string . '&posts_per_page=-1'); ?>
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>

    Use this technique to change the standard WordPress loop limitations of archives, categories, tag pages.

  19. rss milo

    moderator


    rss Posted 3 years ago
    #

    Import Links in WordPress 2.5

    WordPress 2.5 still has a links importer, but you have to go through a few extra steps to get to it:

    1. Login to your WordPress admin
    2. Click “Write”
    3. Click “Link”
    4. Look under the “Related” section on the right
    5. Click “Import Links”

    From there you can use the link importer like you would in WordPress 2.3.

  20. rss milo

    moderator


    rss Posted 3 years ago
    #

    Popular Post List

    <h3>Popular Articles</h3>

    assuming you have a category named popular.

  21. rss milo

    moderator


    rss Posted 3 years ago
    #

    Popular Post List

    <h3>Popular Articles</h3>
    < ul >
    <?php query_posts('category_name=popular'); ?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

  22. < a href = "<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?>< / a>

    <?php the_excerpt(); ?>


  23. <?php endwhile; ?><?php endif; ?>
    < / ul >

    assuming you have a category named popular.

  • rss milo

    moderator


    rss Posted 3 years ago
    #

    Display a Tag Cloud

    <?php wp_tag_cloud(''); ?>

    <?php wp_tag_cloud('smallest=8&largest=36&'); ?>

    second is weighted tagcloud

  • rss milo

    moderator


    rss Posted 3 years ago
    #

    Using Another Stylesheet For Certain Pages

    <?php if ( is_category('1') ) {
    <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/cat-1.css"
    type="text/css" media="screen" />;
    <?php } else { ?>
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>"
    type="text/css" media="screen" />
    <?php } ?>

    add it to your index php file

  • rss milo

    moderator


    rss Posted 3 years ago
    #

    Recent Posts of Specific Categories

    < ul >
    <?php $recent = new WP_Query("cat=1&showposts=10"); while($recent->have_posts()) : $recent->the_post();?>

  • < a href = "<?php the_permalink() ?>" rel="bookmark">
    <?php the_title(); ?>
    < / a>< / li >
    <?php endwhile; ?>
    < / ul>

    where cat 1 is the cat ID

  • Reply »

    You must log in to post.

    Design by milo

    Milo designs web sites that strike the perfect balance between professional high-class graphics, functionality, usability, user experience, and high performance.