76 užitečných tipů

– WordPress Shortcodes
– WordPress Permalinks Outside of the Loop
– Custom Message to Returning Visitors
– Recently Updated Posts and Pages
– Custom Content to Search Engine Visitors
– Last Modified Time and Date for Posts
– Display Total Number of Trackbacks and Pingbacks
– Display Recently Registered Users
– List all of Your Site’s Posts
– List WordPress User Information
– Display List of Scheduled Posts
– Display Private Posts to Logged-in Users
– Display Posts from Exactly One Year Ago
– Custom CSS Styles for Recent Posts
– New WordPress-2.7 Comments Loop
– Backwards-Compatible Comment Templates
– Disable WordPress Post Revisions
– Limit WordPress Post Revisions
– Remove WordPress Post Revisions from the Database
– Reduce Comment Spam by Blocking No-Referrer Requests
– Prevent Google Analytics from Tracking Admin Pages
– Meta Descriptions without a Plugin
– Differentiate Between Posts Depending on Presence of Excerpt
– Modify the wp_options Table via the WordPress Admin
– Alternate Comment Styles
– Automatically Remove Code Mistakes in Posts
– Automatically Disable Comments and Trackbacks in Old Posts
– Access Post Data Outside the Loop
– Display Posts for a Specified Time Period
– Unique Single Post Templates for Different Categories
– Display Performance Statistics for WordPress Pages
– Custom Post Thumbnails in Two Steps
– Highlight Author Comments
– Easy Random Posts
– Display Dates for Groups of Posts
– Display a Sticky Post in the Sidebar
– Display Latest Comments without a Plugin
– Display Most Commented Posts without a Plugin
– Change Permalinks from Date-Based to Post-Date Only
– Test for Sub-Pages
– Multiple Widgetizable Sidebars
– Remove Fancy Quotes from Comments
– Display a List of All Untagged Posts
– Easy Display of Custom Headers, Footers, and Sidebars
– A Better Way for Users to Logout
– Display a Custom Message on a Specific Date
– Display Three Columns of Posts
– Disable WordPress Search Functionality
– Display Posts with Specific Custom Fields
– How to Number Your Comments, Pingbacks, & Trackbacks in 2.7+
– How to Number Your Comments Using the Classic Loop
– Invite Readers to Comment via Feed
– Display the Total Number of Users for Your Blog
– Automatically Insert Content into Your WordPress Post Editor
– How to Prevent Duplicate Content
– Conditionally Display Full Posts or Excerpts
– Display Related Posts without a Plugin
– Drop-Dead Easy Styles for Author Comments
– Display Posts Upcoming Scheduled Posts
– Display Automatic TinyURLs for Your Posts
– Implement a Site-Maintenance Page for Your Blog
– Display the First Image from Each of Your Posts
– Display Most Popular Posts without a Plugin
– Automatically Highlight Search Terms
– Automatically Disable Widgets
– Display All Images from Your Post Content
– Display Category List in Two Columns
– Show Ads or Other Content Only in the First Three Posts
– A Better Way to Display Recent Comments without a Plugin
– Selectively Disable Automatic Post Formatting
– Browser Detection via WordPress’ body_class Function
– Get Post or Page Contents as a PHP Variable
– Simple Example of How to Use WordPress Cron
– Add More Default Avatar Choices to the WordPress Admin
– Add a Private Page to Your Navigation Menu
– How to Add Additional Links to wp_list_pages

„Stupid WordPress Tricks »“:http://perishablepress.com/stupid-wordpress-tricks/

Bezplatné responzivní šablony Themes4all

Včetně demoverzí. Responzivní témata jsou označena symbolem mobile

„http://www.themes4all.com/gallery/?category=114“:http://www.themes4all.com/gallery/?category=114

Komu by to nestačilo, dalších „325 responzivních bezplatných šablon pro WordPress »“:http://www.webdesignrazzi.com/2014/free-wordpress-themes/

Drobečková navigace bez použití pluginu

Do functions.php vložíme:

/—code php
function the_breadcrumb() {
echo ‚

    ‚;
    if (!is_home()) {
    echo ‚

  • ‚;
    echo ‚Home‘;
    echo „
  • „;
    if (is_category() || is_single()) {
    echo ‚

  • ‚;
    the_category(‚
  • ‚);
    if (is_single()) {
    echo „
  • „;
    the_title();
    echo ‚
  • ‚;
    }
    } elseif (is_page()) {
    echo ‚

  • ‚;
    echo the_title();
    echo ‚
  • ‚;
    }
    }
    elseif (is_tag()) {single_tag_title();}
    elseif (is_day()) {echo“

  • Archive for „; the_time(‚F jS, Y‘); echo‘
  • ‚;}
    elseif (is_month()) {echo“

  • Archive for „; the_time(‚F, Y‘); echo‘
  • ‚;}
    elseif (is_year()) {echo“

  • Archive for „; the_time(‚Y‘); echo‘
  • ‚;}
    elseif (is_author()) {echo“

  • Author Archive“; echo‘
  • ‚;}
    elseif (isset($_GET[‚paged‘]) && !empty($_GET[‚paged‘]))
    {echo „

  • Blog Archives“; echo‘
  • ‚;}
    elseif (is_search()) {echo“

  • Search Results“; echo‘
  • ‚;}
    echo ‚

‚;
}
\—

V šabloně funkci zavoláme:

/—code php
the_breadcrumb();
\—

„Zdroj »“:http://wp-snippets.com/breadcrumbs-without-plugin/

Galerie – obrázky v mřížce

**Space Boxes**
„Your text to link…“:http://wordpress.org/plugins/space-boxes/

Space Boxes was designed to make building content & media grids quick and painless. Each Space Box set is created solely with a WordPress gallery inserted into a custom post type. When you insert the shortcode [spaceboxes id=XX”] , it will display the title, and caption for each image, if they are provided.

Have 7 images in your gallery? Then you’ll have 7 boxes. Want a lightbox? No problem. Control over the grid? Check! There’s even a portfolio mode to show off images or product screenshots. You can also use the gallery to drag and drop your boxes in the order that you want them displayed.

„Demo »“:http://space-boxes.nickhaskins.co/

Import XML a CSV souborů

**WP All Import**

Import any XML or CSV File to WordPress

Makes it easy to import any XML or CSV file to WordPress. Has a four step import process and an intuitive drag & drop interface that makes complicated import tasks simple and fast.

Can be used for everything from migrating content from a legacy CMS to WordPress to building a store with an affiliate datafeed to displaying live stock quotes or sports scores to building a real estate portal.

Our YouTube channel has many „videos“:http://www.youtube.com/soflyyplugins showing WP All Import in action. „Documentation of advanced features »“:http://www.wpallimport.com/documentation/

Přidání custom posts do výsledků vyhledávání

Do functions.php přidáme

/—code php
add_filter( ‚pre_get_posts‘, ‚tgm_cpt_search‘ );
/**
* This function modifies the main WordPress query to include an array of post types instead of the default ‚post‘ post type.
*
* @param mixed $query The original query
* @return $query The amended query
*/
function tgm_cpt_search( $query ) {
if ( $query->is_search )
$query->set( ‚post_type‘, array( ‚post‘, ‚movies‘, ‚products‘, ‚portfolio‘ ) );
return $query;
};
\—

Automatický náhledový obrázek

**Auto Post Thumbnail**
„http://wordpress.org/plugins/auto-post-thumbnail/“:http://wordpress.org/plugins/auto-post-thumbnail/

Automatically generate the Post Thumbnail (Featured Thumbnail) from the first image in post or any custom post type only if Post Thumbnail is not set.

If the post thumbnail is already present, the plugin will do nothing. If you don’t want a post thumbnail for some post with images, just add a custom field skip_post_thumb to the post and the plugin will restrain itself from generating post thumbnail. The plugin also provides a Batch Processing capability to generate post thumbnails for already published posts.

**Další pluginy**
„http://beginnersbook.com/2013/09/set-default-thumbnail-featured-fallback-image-wordpress-automatically/“:http://beginnersbook.com/2013/09/set-default-thumbnail-featured-fallback-image-wordpress-automatically/
„http://wpfreesetup.com/fix-featured-image-issues-wordpress-plugins/“:http://wpfreesetup.com/fix-featured-image-issues-wordpress-plugins/

*nebo pomocí funkcí:*

/—code php
ID);
if (!$already_has_thumb) {
$attached_image = get_children( „post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=1“ );
if ($attached_image) {
foreach ($attached_image as $attachment_id => $attachment) {
set_post_thumbnail($post->ID, $attachment_id);
}
}
}
}
add_action(‚the_post‘, ‚autoset_featured‘);
add_action(‚save_post‘, ‚autoset_featured‘);
add_action(‚draft_to_publish‘, ‚autoset_featured‘);
add_action(‚new_to_publish‘, ‚autoset_featured‘);
add_action(‚pending_to_publish‘, ‚autoset_featured‘);
add_action(‚future_to_publish‘, ‚autoset_featured‘);
?>
\—

*alternativně*

/—code php
function set_first_as_featured($attachment_ID){
$post_ID = get_post($attachment_ID)->post_parent;
if(!has_post_thumbnail($post_ID)){
set_post_thumbnail($post_ID, $attachment_ID);
}
}
add_action(‚add_attachment‘, ‚set_first_as_featured‘);
add_action(‚edit_attachment‘, ‚set_first_as_featured‘);
\—

On every upload / edit attachment, function checks if the post already has featured image. If it has not, image in question is set as featured. Every next picture will be ignored (since post already has featured image).

*případně*

/—code php
wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), ‚thumbnail‘ )[0];
\—

„Get The First Image From a Post »“:http://css-tricks.com/snippets/wordpress/get-the-first-image-from-a-post/

Podmíněné zobrazování položek menu

**If Menu**
„http://wordpress.org/plugins/if-menu/“:http://wordpress.org/plugins/if-menu/

Simple plugin that adds extra functionality to Menu Items. The plugin will allow to show or hide menu items based on condition statements (Is single page, User is Logged In, etc).

The management is very easy, each menu item will have a „Enable Conditional Logic“ check, that will allow to select a conditional statement

Vylepšený widget pro vkládání textu nebo kódu

**Enhanced Text Widget**
„http://wordpress.org/plugins/enhanced-text-widget/“:http://wordpress.org/plugins/enhanced-text-widget/

An enhanced version of the default text widget where you may have Text, HTML, CSS, JavaScript, Flash, WordPress Shortcodes and/or PHP as content with linkable widget title.