Související příspěvky

**Related Posts Slider**
„http://wordpress.org/extend/plugins/related-posts-slider/“:http://wordpress.org/extend/plugins/related-posts-slider/

Related posts slider creates a very attractive slider of the related posts or/and pages for a WordPress post or page.
The slider is a lightweight jQuery implementation of the related post functionality. It has a ready shortcode and widget as well to insert the slider.

– Showcase related posts in slider format, either in news style or in horizontal carousel format
– Complete CSS customization from settings panel
– Compatible with „YARPP plugin“:http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/ and „WordPress Related Posts plugin“:http://wordpress.org/extend/plugins/wordpress-23-related-posts-plugin/
– Widget option available for Related Posts Slider
– Shortcode option to insert Related Posts Slider in between the content of a post
– Translation ready

[* http://s.wordpress.org/extend/plugins/related-posts-slider/screenshot-1.png?r=465251 *]

[* http://s.wordpress.org/extend/plugins/related-posts-slider/screenshot-2.png?r=465251 *]

*Alternativy*

Manuální nastavení souvisejících příspěvků

**Manual Related Posts**
„https://wordpress.org/plugins/baw-manual-related-posts/“:https://wordpress.org/plugins/baw-manual-related-posts/

You can manually choose which posts have to be be linked to every posts. Just click „Add related posts“, search for a post, click, add. Posts are linked to each others, example if you add on „Post A“ the „Post B“, then the „Post B“ will be linked to „Post A“ automatically, even if you can not see it in the backend.

„7 Awesome Related Post (Thumbnail) Plugins for WordPress »“:http://www.bloggenie.ca/best-related-post-plugins-thumbnails-wordpress/

Menu s ikonami

A simple way to customize our WordPress menu, without losing its wonderful admin options. We will be doing:

– Home link in our wp_nav_menu that always gets current blog url
– Customize each menu item as you want
– Put pretty icons in our menu
– Active item highlight

„http://www.1stwebdesigner.com/wordpress/wordpress-wp-nav-menu-tutorial/“:http://www.1stwebdesigner.com/wordpress/wordpress-wp-nav-menu-tutorial/

[* http://www.1stwebdesigner.com/wp-content/uploads/2011/05/preview_large_wp_nav_tut.jpg *]

Odstranění skoku u odkazu „Číst dále“

Mě osobně irituje, když po kliknutí na tlačítko „Číst dále“ mě to automaticky hodí někam doprostřed článku. Nemám rád podobné skoky prohlížeče, já si tam totiž dokážu zascrollovat sám. A protože myslím na svého návštěvníka, tak něco podobného může u mě najít pouze ve spojení s komentáři. Návod, jak situaci s tagem MORE vyřešit nám […]

Multikriteriální filtrování (vyhledávání) příspěvků

**Multiple Category Selection Widget**
„http://wordpress.org/extend/plugins/multiple-category-selection-widget/“:http://wordpress.org/extend/plugins/multiple-category-selection-widget/

This plugin gives you the ability to provide your users with a widget full of dropdowns based upon parent categories and their sub-categories.
You can now set up an AJAX chained select box. For example, if you have multiple countries, and multiple states for each country, you can get a user to select a country. Upon selecting the country, the plugin looks for any states under that country, and then shows the dropdown box for the states under that country beneath the country dropdown.

Multiple subcategories spanning multiple parent categories (though multiple categories inside a single parent cannot be chosen) are chosen and intelligently filter your posts.

Please note that this plugin, while it is a widget, can be used on a sidebar you define anywhere within your theme that you like. Think of it as a ‚block‘ area rather than a ‚sidebar‘.

*Alternativy*

**WP Ultimate Search**
„https://wordpress.org/plugins/wp-ultimate-search/screenshots/“:https://wordpress.org/plugins/wp-ultimate-search/screenshots/

Powerful AJAX-based search alternative which supports faceting queries by taxonomies, terms, location, and post metadata.

**Query Multiple Taxonomies**
„http://wordpress.org/extend/plugins/query-multiple-taxonomies/“:http://wordpress.org/extend/plugins/query-multiple-taxonomies/

Say you have two custom taxnomies defined: *genre* and *artist*.

Currently, you can do the following types of queries on your site:
?genre=jazz
?genre=jazz&cat=1

But you can’t do this:
?genre=jazz&artist=chet-baker

WordPress will just ignore one of the parameters. This plugin fixes that. It also comes with a drill-down navigation widget.

[* http://s.wordpress.org/extend/plugins/query-multiple-taxonomies/screenshot-1.png?r=358842 *]

**WP Custom Fields Search**
„http://wordpress.org/extend/plugins/wp-custom-fields-search/“:http://wordpress.org/extend/plugins/wp-custom-fields-search/

This plugin allows multiple form inputs to be configured to search different aspects of a post including custom fields.
It is designed to filter posts in a more structured way than the default wordpress search. Specifically it allows multiple form inputs to be configured to search different aspects of a post, i.e. one term could search the post content, one the post title and one could search a custom field associated with the post.

The blog admin is able to build a customised search form. It allows you to search by the standard post information and by custom fields and to choose what HTML form elements should be presented for each search field.

**Taxonomy Picker**
„http://wordpress.org/extend/plugins/taxonomy-picker/“:http://wordpress.org/extend/plugins/taxonomy-picker/

Taxonomy Picker is a widget which you can include in your sidebar to help visitors build complex queries using categories and your custom taxonomies by chosing terms from drop down boxes. The widget also includes a text search making it easy to search for text only within certain categories or taxonomies.
Results will be displayed using your theme’s standard search form so the results need no additonal styling.

„Demo »“:http://www.egyptological.com/find

**Úpravou kódu (bez pluginů)**

Výběr (průnik) z více štítků současně, zaškrtáváním checkboxů v šabloně stránky s filtrem:

/—code php

term_id.'“>‘.$tag->name.‘‚;
endforeach;
print $checkboxes;
?>

$value) {
// tag1 AND tag2 is chosen, add a plus after the tags.
$string .= $value.’+‘;
}
// Remove the last + symbol in the string
$tags = substr($string, 0, -1);
}

// build the url with the variables
$url = home_url().“?tag=$tags“;

// redirect to output page
wp_redirect($url); exit;
endif; ?>
\—

Výběr (průnik) z více kategorií současně, zaškrtáváním checkboxů:

U kategorií je třeba ještě nejprve přidat do *functions.php*
/—code php
// List categories with checkboxes
function get_categories_checkboxes( $selected_cats = null ) {
$all_categories = get_categories();
$o = ‚

    ‚;
    foreach($all_categories as $key => $cat) {
    if($cat->parent == „0“) $o .= __show_category($cat, $selected_cats);
    }
    return $o.‘

‚;
}

function __show_category($cat_object, $selected_cats = null) {
$checked = „“;
if(!is_null($selected_cats) && is_array($selected_cats)) {
$checked = (in_array($cat_object->cat_ID, $selected_cats)) ? ‚checked=“checked“‚ : „“;
}
$ou = ‚

  • ‚;
    return $ou;
    }

    // get category slug form id
    function get_cat_slug($cat_id) {
    $cat_id = (int) $cat_id;
    $category = &get_category($cat_id);
    return $category->slug;
    }
    \—

    a v šabloně stránky s filtrem pak

    /—code php

    $value) {
    // cat1 AND cat2 is chosen, add a plus after the cats.
    $slug = get_cat_slug($value);
    $string .= $slug.’+‘;
    }
    // Remove the last + symbol in the string
    $cats = substr($string, 0, -1);
    }

    // build the url with the variables
    $url = home_url().“/rubriky/“.$cats.“/“;

    // redirect to output page
    wp_redirect($url); exit;
    endif; ?>
    \—

    This shows 15 posts (total) from categories 3 and 11 and 9

    /—code php



    \—

    „List categories with checkboxes »“:http://translate.google.com/translate?hl=en&sl=it&tl=en&u=http%3A%2F%2Fwww.undolog.com%2Fcategory%2Fwordpress%2Fpage%2F2%2F

    „Filtering WordPress categories using undocumented hook »“:http://soulsizzle.com/wordpress/filtering-wordpress-categories-using-an-undocumented-hook/

    Submenu v sidebaru

    **Sub Page Navigation Widget**
    „http://wordpress.org/extend/plugins/sub-page-navigation-widget/“:http://wordpress.org/extend/plugins/sub-page-navigation-widget/

    This Widget displays a navigation structure to all sub pages of the current one in your sidebar. You can add this widget to sidebars on pages to show all sub pages of the current one.

    Články ze stejné a nadřazené kategorie

    Určitě už jste někdy chtěli, aby byli pod každým článkem uveřejněny další odkazy na texty ze stejné kategorie. To není až tak těžké. Tady se dozvíte, jak je vypisovat i z nadřazené rubriky a to tak, aby se vám v seznamu nic neopakovalo dvakrát.

    $categ = get_the_category($post->ID);
    $not = array($post->ID);
    
    $my_query3 = new WP_Query(array ('cat' => $categ[0]->term_id, 'showposts' => 3, 'orderby' => 'rand', 'post__not_in'=> $not));
    while ($my_query3->have_posts()) {
     $my_query3->the_post();
     echo "<a href='";
     the_permalink();
     echo "'>" . get_the_title() . "</a>";
     $not[] = get_the_ID();
     }
    
    $my_query2 = new WP_Query(array ('cat' => $categ[0]->parent, 'showposts' => 3, 'orderby' => 'rand', 'post__not_in'=> $not));
    while ($my_query2->have_posts()) {
     $my_query2->the_post();
     echo "<a href='";
     the_permalink();
     echo "'>" . get_the_title() . "</a>";
     }

    Celé to funguje tak, že id každého načteného článku se uloží do proměnné not a jejich zobrazování se následně zakáže v dalším vypisování. Pokud máte nějaké dotazy nebo si nevíte rady s přesným provedením, tak můžete zanechat komentář.

    Prolinkování webů tagy

    **Tag Search**
    „http://wordpress.org/extend/plugins/tag-search/“:http://wordpress.org/extend/plugins/tag-search/

    Tag search grabs your saved post tags and when a tag word or phrase is encountered in your post content, Tag Search automatically creates a link which is pointed to the search page to turn the tag into a search term. When the user clicks the linked tag word or phrase all posts found to contain the tag word or phrase will be returned in the results. This is different from similar plugins that link the tagged word or phrase to it’s tag page so only those posts sharing the tag are returned.

    *Alternativa*

    **WP-Hashtag**
    „http://wordpress.org/extend/plugins/wp-hashtag/“:http://wordpress.org/extend/plugins/wp-hashtag/

    Pokud při psaní nějakého příspěvku vložíte před nějaké slovo „křížek“, tj. např. **#slovo**, pak se toto slovo jednak automaticky po uložení stane štítkem daného příspěvku (pokud podobný štítek neexistoval, tak se vytvoří) a současně bude toto slovo prolinkováno.

    Zobrazování substránek v menu

    Dnes si ukážeme, jak správně pracovat se substránkami v menu. Budeme se snažit, aby se podstránky zobrazily pouze v případě, že jsme aktuálně na stránce rodiče nebo sourozence. Toho dosáhneme pomocí funkce wp_list_pages() a kaskádových stylů.

    Prvním krokem se stane vytvoření samotného systému substránek:

    Vzniklý kód pak musíme správně nastylovat. To nám umožní wordpress, který chytře vypisuje hodnotu class na jednotlivé položky menu.

    .page_menu ul.children {display: none}
    .page_menu li.current_page_ancestor ul,.page_menu li.current_page_item ul {display: block}
    

    Vy výchozím stavu se tedy všechny podstránky skryjí, ale pokud je aktivní rodič nebo sourozenec, tak se zaktivní. Jak jednoduché, jak prosté.

    Snadné stránkování bez pluginu

    Pokud chcete své příspěvky ve WordPress stránkovat, musíte obvykle sáhnout po nějakém pluginu. Což rozhodně není ideální řešení. Stránkování obsahu je prostě základní funkce. Je škoda, že to WordPress neumí bez nějakého zbytečného pluginu!

    Jenže on to umí. V administraci se stránkování obsahu používá téměř všude. Což mimo jiné znamená, že na to existuje funkce. Stačí ji tedy jen dobře použít:

    $pagination = array(
    	'base' => get_pagenum_link().'%_%',
    	'format' => 'page/%#%',
    	'total' => ceil($wp_query->found_posts / get_settings('posts_per_page')),
    	'current' => absint( get_query_var( 'paged' ) ),
    	'show_all' => false,
    	'prev_next' => true,
    	'prev_text' => __('&laquo; Previous'),
    	'next_text' => __('Next &raquo;'),
    	'end_size' => 3,
    	'mid_size' => 5,
    	'type' => 'plain',
    	'add_args' => false,
    	'add_fragment' => ''
    );
    
    echo paginate_links($pagination);
    

    Funkce paginate_links má řadu vstupních parametrů, které jsou podrobně popsány v dokumentaci.

    Nejdůležitější je samozřejmě total – měl by obsahovat počet stránek. Ten jsem vypočítal jako zaokrouhlený podíl celkového počtu příspěvku a počtu příspěvků na stránku (tohle se nastavuje se v administraci).

    Parametr current by měl obsahovat číslo aktuálně prohlížené stránky. Zjistíte jej snadno pomocí get_query_var. Další dva neméně důležité parametry jsou baseformat – pomocí kterých se tvoří URL odkazu.

    Base by měl obsahovat základní část URL. Což je ta část, které se při procházení jednotlivých stránek nemění. Nenapadl mě lepší způsob, než zavolat funkci get_pagenum_link. Řetězec %_% bude při tvorbě URL nahrazen obsahem parametru format.

    Format je ono samotné stránkování. Měl by obsahovat tu část URL, která se bude měnit. V mém příkladu využívám tzv. hezké URL. Takže číslo stránky je očekávané za page. Řetězec %#% bude nahrazen čísly. Výsledná URL tak bude vypadat například takto http://www.nabito.net/page/2

    Ostatní parametry jsou spíš doplňkové.