Jak omezit listování v příspěvcích pouze na rubriku, ve které je příspěvek

Jednoduchý způsob přímo v šabloně:

previous_post_link( '%link', 'Prev post in category', true );
next_post_link( '%link', 'Next post in category', true );

V případě, že nechceme zasahovat do šablony (potřebujeme např. upravit listování v rubrice v single.php v Twentyfifteen), stačí vložit do functions.php tento kód:

add_filter( 'get_next_post_join', 'navigate_in_same_taxonomy_join', 20);
add_filter( 'get_previous_post_join', 'navigate_in_same_taxonomy_join', 20 );
function navigate_in_same_taxonomy_join() {
        global $wpdb;
        return " INNER JOIN $wpdb->term_relationships AS tr ON p.ID = tr.object_id INNER JOIN $wpdb->term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id";

add_filter( 'get_next_post_where' , 'navigate_in_same_taxonomy_where' );
add_filter( 'get_previous_post_where' , 'navigate_in_same_taxonomy_where' );
function navigate_in_same_taxonomy_where( $original ) {
        global $wpdb, $post;
        $where          = '';
        $taxonomy       = 'category';
        $op             = ('get_previous_post_where' == current_filter()) ? '<' : '>';
        $where          = $wpdb->prepare( "AND tt.taxonomy = %s", $taxonomy );
        if ( ! is_object_in_taxonomy( $post->post_type, $taxonomy ) )
                return $original ;

        $term_array = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) );

        $term_array = array_map( 'intval', $term_array );

        if ( ! $term_array || is_wp_error( $term_array ) )
                return $original ;

        $where          = " AND tt.term_id IN (" . implode( ',', $term_array ) . ")";
        return $wpdb->prepare( "WHERE p.post_date $op %s AND p.post_type = %s AND p.post_status = 'publish' $where", $post->post_date, $post->post_type );

Zdroj »

Vylepšená knihovna médií

Enhanced Media Library

The plugin will be handy for those who need to manage a lot of media files.

Categories and Tags for media items

Various media categories. With the plugin installed you immediately obtain Media Categories for categorizing and filtering media items in WordPress admin. This feature alone will save you hours of searching through a media library with even as few as 100 images.

Media items categorizing can be useful for the front-end as well. To insert media galleries or audio / video playlists based on media categories you have to use the familiar shortcode format like

[gallery media_category="5" category="2" limit="10" monthnum="12" year="2015" orderby="title" order="DESC"]

Zobrazení příspěvků v mřížce

Content Views

Content Views helps you to display latest posts on any page, and more:

  • display posts by category, tag, author, ID, keyword, status
  • display pages by author, ID, keyword, status
  • display children of a parent page
  • sort posts by title, date, ID
  • display any post data: featured image, title, full content or excerpt, meta fields (date, author, category, tag, comment count)
  • display featured image in any size (thumbnail, medium, large, full...)
  • limit number of posts to display
  • enable/disable pagination (ajax, non-ajax)
  • custom actions, filters hook for developers

It provides you a friendly form to filter & display posts quickly, in 3 simple steps:

  • Step 1 : Filter any posts (by ID, category, tag, author, keyword, status)
  • Step 2 : Select layout (grid, scrollable list, collapsible list) to display your posts. You can choose to display any post data (title, featured image, full content or excerpt, meta fields)
  • Step 3 : Paste generated shortcode to anywhere you want (page content, text widget, theme template file...)

Metadata v taxonomiích

Category and Taxonomy Meta Fields

Plugin to add custom meta fields within built in and custom taxonomies. Simply add the desired fields by going through WP-admin -> Settings ->Taxonomy Meta .
You can add following fields with category/taxonomy:

  • Image
  • Input Text
  • Textarea
  • Checkbox

Taxonomy Metadata

This plugin implements the metadata infrastructure for taxonomy terms, so you can add custom metadata (by key) to tags, categories, and other taxonomies. The majority of the code is from sirzooro's submission to the WordPress Core Trac. The rest of the plugin is simply some hacky glue to make this work without modifying the Core. It does not implement any UI for taxonomy term metadata.

Meta for taxonomies

Add meta for any taxonomies. Meta is attached to taxonomy context and not terms, this way allow to have metas different for the same term on 2 different taxonomies. This plugin don't any interface on WordPress ! Only somes methods for developpers.

Taxonomy Images

Associate images from your media library to categories, tags and custom taxonomies.

Carbon Fields

Developer-oriented library for WordPress custom fields for all types of WordPress content.
Carbon fields is a plugin that can be used as a library for easy creation of custom fields in the WordPress administration panel.
Can be created for post types, taxonomy terms, users, comments, options, navigation menus and even widgets.

Návrat WordPressu do výchozího nastavení

Advanced WordPress Reset

Plugin will reset you WordPress Database back to its first original status in order to make a fresh installation without going through WordPress traditional installation. This plugin will help you saving time especially if you are a developer and you have to install WordPress from scratch each time.

  • Resets the database without deleting or modifying any of your files (all your WordPress, plugins and themes files are kept)
  • Deletes all database customizations made by plugins and themes.
  • Deletes all content including post, pages, options, etc.
  • Detects the Admin user and recreate it with its saved password
  • Keeps the blog name after the reset

WordPress Database Reset

The WordPress Database Reset plugin allows you to reset the database back to its default settings without having to go through the WordPress 5 minute installation.

  • Extremely fast one click process to reset the WordPress database
  • Choose to reset the entire database or specific database tables
  • Secure and super simple to use
  • Prefer the command line? Reset the database in one command
  • Excellent for theme and plugin developers who need to clean the database of any unnecessary content

Zobrazování metaboxů pouze na vybraných stránkách

function my_meta_init()
$post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'] ;
// checks for post/page ID
if ($post_id == '84')
add_meta_box('my_all_meta_1', 'My Custom Meta Box 1', 'my_meta_setup_1', 'page', 'normal', 'high');
$template_file = get_post_meta($post_id,'_wp_page_template',TRUE);
// check for a template type
if ($template_file == 'home.php')
add_meta_box('my_meta_2', 'My Custom Meta Box 2', 'my_meta_setup_2', 'page', 'normal', 'high');
// add a meta box for custom page types
foreach (array('events','page') as $type)
add_meta_box('my_meta_3', 'My Custom Meta Box 3', 'my_meta_setup_3', $type, 'normal', 'high');

Zdroj »