https://kechlibar.net/2018/12/11/macronova-predbezna-kapitulace/
Strana 31 z 44

WordPress built-in RSS feeds are definitely cool. But if you’re using WordPress to create a simple website, you may do not need the feeds at all. So what about disabling them? Here’s a simple and clean way to do it.
Paste the code below into your functions.php file. RSS feeds will not be available anymore after you saved the file.
1 2 3 4 5 6 7 8 |
unction digwp_disable_feed() { wp_die(__('<h1>Feed not available, please visit our <a href="'.get_bloginfo('url').'">Home Page</a>!</h1>')); } add_action('do_feed', 'digwp_disable_feed', 1); add_action('do_feed_rdf', 'digwp_disable_feed', 1); add_action('do_feed_rss', 'digwp_disable_feed', 1); add_action('do_feed_rss2', 'digwp_disable_feed', 1); add_action('do_feed_atom', 'digwp_disable_feed', 1); |

On WordPress dashboard, there’s an option to divide comments lists in sub pages. Unfortunately, there’s no built-in conditional tag to know if you’re currently on a comment page. So let’s built one!
Simply put the following code anywhere on your theme files. If you’re on a comment page, the conditional statement will return true, so any code within brackets will be executed.
1 2 3 4 |
$cpage = get_query_var( 'cpage' ); if ( is_singular() && $cpage > 0 ){ // Your code here } |
This code works on posts, pages, attachments as well as all custom post_types.

If you want to add a breadcrumb to your blog, you can use one of the many available plugins to do so. But why using a plugin when you can easily code it yourself? Here’s a ready to use code snippet to add a breadcrumb to your WordPress blog.
Open your functions.php and paste the code below in it:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
function the_breadcrumb() { echo '<ul id="crumbs">'; if (!is_home()) { echo '<li><a href="'; echo get_option('home'); echo '">'; echo 'Home'; echo "</a></li>"; if (is_category() || is_single()) { echo '<li>'; the_category(' </li><li> '); if (is_single()) { echo "</li><li>"; the_title(); echo '</li>'; } } elseif (is_page()) { echo '<li>'; echo the_title(); echo '</li>'; } } elseif (is_tag()) {single_tag_title();} elseif (is_day()) {echo"<li>Archive for "; the_time('F jS, Y'); echo'</li>';} elseif (is_month()) {echo"<li>Archive for "; the_time('F, Y'); echo'</li>';} elseif (is_year()) {echo"<li>Archive for "; the_time('Y'); echo'</li>';} elseif (is_author()) {echo"<li>Author Archive"; echo'</li>';} elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {echo "<li>Blog Archives"; echo'</li>';} elseif (is_search()) {echo"<li>Search Results"; echo'</li>';} echo '</ul>'; } |
Once done, open header.php and call the function:
1 |
<?php the_breadcrumb(); ?> |

Have you ever wanted to change the default role names (Administrator, Editor, Author, Contributor, Subscriber) within WordPress? Here is a super useful snippet to do so.
Simply paste this code into your function.php file. Edit lines 5 and 6 at your convenience.
1 2 3 4 5 6 7 8 |
function wps_change_role_name() { global $wp_roles; if ( ! isset( $wp_roles ) ) $wp_roles = new WP_Roles(); $wp_roles->roles['contributor']['name'] = 'Owner'; $wp_roles->role_names['contributor'] = 'Owner'; } add_action('init', 'wps_change_role_name'); |

Potřebujete ve WordPressu vypisovat cenu v několika měnách? Pak vám přijde vhod dnešní návod na shortcode, který kurzy bere přímo od České národní banky.

V dnešním tipu pro úpravu si ukážeme, jak vytvořit seriál článků. Vaši čtenáři jistě ocení, že si nebudou muset další, na sebe navazující díly, složitě hledat na webu. Případně vy nebudete muset vkládat odkazy na ně ručně.

Pokud uděláte webovou stránku na WordPressu, často se stává, že její bytí či nebytí bezpodmínečně závisí na určitých pluginech. A pokud se o svůj výtvor nestaráte sami, mohlo by se stát, že je nějaký šťoura vypne a komplet tím zruší celý web. To by samozřejmě bylo velice nepříjemné, a proto je třeba se proti tomu účinně bránit.
https://kechlibar.net/2018/11/30/stredovek-trva-a-trva/