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ě:

/—code php
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:

/—code php
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 »“:http://presscustomizr.com/snippet/restrict-post-navigation-category/

Jak přidat vyhledávání do menu (když není v šabloně)

**TB Search in Menu**
„https://cs.wordpress.org/plugins/tb-search-in-menu/“:https://cs.wordpress.org/plugins/tb-search-in-menu/

Using TB Search in Menu you can easily add a search item in your menu that will show a modern search form when clicked. All you need to do is activate the plugin and choose the menu location where you want your search item to be shown.

Vylepšená knihovna médií

**Enhanced Media Library**
„https://cs.wordpress.org/plugins/enhanced-media-library/“:https://cs.wordpress.org/plugins/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**
„https://cs.wordpress.org/plugins/content-views-query-and-display-post-page/“:https://cs.wordpress.org/plugins/content-views-query-and-display-post-page/

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…)

Elementor Page Builder (drag & drop)

**Elementor Page Builder**
„https://wordpress.org/plugins/elementor/“:https://wordpress.org/plugins/elementor/

The most advanced frontend drag & drop page builder. Create high-end, pixel perfect websites at record speeds. Any theme, any page, any design. Compatible with PHP 5.4 or greater.

Metadata v taxonomiích

**Category and Taxonomy Meta Fields**
„https://wordpress.org/plugins/wp-custom-taxonomy-meta/“:https://wordpress.org/plugins/wp-custom-taxonomy-meta/

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**
„https://wordpress.org/plugins/taxonomy-metadata/“:https://wordpress.org/plugins/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**
„https://wordpress.org/plugins/meta-for-taxonomies/“:https://wordpress.org/plugins/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**
„https://wordpress.org/plugins/taxonomy-images/“:https://wordpress.org/plugins/taxonomy-images/

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

**Carbon Fields**
„https://wordpress.org/plugins/carbon-fields/“:https://wordpress.org/plugins/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**
„https://wordpress.org/plugins/advanced-wp-reset/“:https://wordpress.org/plugins/advanced-wp-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**
„https://wordpress.org/plugins/wordpress-database-reset/“:https://wordpress.org/plugins/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

/—code php
add_action(‚admin_init‘,’my_meta_init‘);
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‘);
}
add_action(‚save_post‘,’my_meta_save‘);
}
\—

„Zdroj »“:http://www.farinspace.com/page-specific-wordpress-meta-box/

Vypnutí komentářů u WP media příloh

/—code php
function filter_media_comment_status( $open, $post_id ) {
$post = get_post( $post_id );
if( $post->post_type == ‚attachment‘ ) {
return false;
}
return $open;
}
add_filter( ‚comments_open‘, ‚filter_media_comment_status‘, 10 , 2 );
\—

„Zdroj »“:http://www.wpbeginner.com/wp-tutorials/how-to-disable-comments-on-wordpress-media-attachments/

Knihovna dokumentů

**Document Gallery**
„https://wordpress.org/plugins/document-gallery/“:https://wordpress.org/plugins/document-gallery/

This plugin allows the user to effortlessly create a gallery of documents and other attached media, much like the gallery option already available for image attachments.

https://youtu.be/Xb7RVzfeUUg