WPBeginner » Editorial Staff http://www.wpbeginner.com Beginner's Guide for WordPress Sat, 21 Mar 2015 21:25:22 +0000 en-US hourly 1 http://wordpress.org/?v=4.1.1 How to Expire Posts or Partial Post Content in WordPress http://www.wpbeginner.com/plugins/how-to-expire-posts-or-partial-post-content-in-wordpress/ http://www.wpbeginner.com/plugins/how-to-expire-posts-or-partial-post-content-in-wordpress/#respond Fri, 20 Mar 2015 08:00:44 +0000 http://www.wpbeginner.com/?p=2661 Have you ever wished that you can set an expiration date for your blog posts? Perhaps you have timely content such as deals or giveaways that have been outdated which you want to automatically expire? In this article, we will show you how to expire… Read More »

To leave a comment please visit How to Expire Posts or Partial Post Content in WordPress on WPBeginner.

]]>
Have you ever wished that you can set an expiration date for your blog posts? Perhaps you have timely content such as deals or giveaways that have been outdated which you want to automatically expire? In this article, we will show you how to expire posts and pages in WordPress. We will also show you how to schedule part of your post or page content to be expired after a specific date.

Expire Post Content

When would you want to expire posts or partial post content?

The primary use case of post expiration is to expire time-sensitive content such as special deals, coupons, giveaways, and event announcements.

In certain cases, you may want to keep the post active on your site because it is helpful, but only expire partial content such as a special limited-time discount coupon which no longer works..

First let’s take a look at how to expire posts, then we will look at how to expire partial post content.

How to Expire Posts in WordPress?

There are ways to customize the WordPress loop with PHP codes and utilize custom fields to make this happen, but that is too much work. Let’s take a look at an easier solution: Post Expirator plugin.

First thing you need to do is install and activate the plugin. Once activate, go to edit any WordPress post or page, and you will see a new metabox like this:

Post Expirator - WordPress Plugin

You can enable the post expiration and select the date / time that you want this post to expire on.

You are probably wondering what happens to the post once it is expired. Well, you get to decide that. There are several options to choose from.

You can either make it a draft (unpublish it), set it to private, delete the post altogether, or you can change the post category.

You also have additional settings that you can configure from the settings page found under Settings » Post Expirator.

Post Expirator Settings - WordPress Plugin

You can choose the date and time format along with the default expiration category. You also have the option to add the post expiration date at the end of your content to let your users know when this post or page will be expiring.

Post Expirator Footer Settings - WordPress Plugin

Another plugin that offers similar functionality is called Simple Post Expiration.

How to Expire Partial Post Content in WordPress

The above method shows you how to expire the entire post or page, but in some cases that is not what you want. You may just want to remove part of the post or page content after a certain time. Well in that case, the plugin called Scheduled Content is your best solution.

This plugin allows you to schedule part of your post content to be published and expired based on the dates you specify.

First thing you need to do is install and activate the plugin. Once you have done that, there are no additional settings. All you need to do is wrap your content with the shortcode and set the date/time you’d like it to expire on. When that time arrives, this content will disappear and no longer be visible to your users.

[schedule on=’2014-12-01′ at=”10:01″ expon=’2014-12-01′ expat=”13:15″] the content you want to hide here [/schedule]

The date has to be set in yy-mm-dd format, and time has to be set in the 24 hours format.

The time is compared with your blog’s time zone settings, so make sure you have the right time zone by going to Settings » General.

You can also add shortcodes inside this schedule shortcode as well.

We hope this article helped you learn how to expire posts in WordPress and expire partial post and page content in WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

To leave a comment please visit How to Expire Posts or Partial Post Content in WordPress on WPBeginner.

]]>
http://www.wpbeginner.com/plugins/how-to-expire-posts-or-partial-post-content-in-wordpress/feed/ 0
How to Disable Automatic Updates in WordPress http://www.wpbeginner.com/wp-tutorials/how-to-disable-automatic-updates-in-wordpress/ http://www.wpbeginner.com/wp-tutorials/how-to-disable-automatic-updates-in-wordpress/#comments Thu, 19 Mar 2015 11:00:19 +0000 http://www.wpbeginner.com/?p=16776 Did you know that WordPress can automatically update your website? Yes that include plugins and themes too. Despite the security benefits, there is a slight chance that it can break your website. In this article, we will show you how to disable automatic background updates… Read More »

To leave a comment please visit How to Disable Automatic Updates in WordPress on WPBeginner.

]]>
Did you know that WordPress can automatically update your website? Yes that include plugins and themes too. Despite the security benefits, there is a slight chance that it can break your website. In this article, we will show you how to disable automatic background updates in WordPress.

Note: This post was originally published on Oct 25, 2013, but we have updated it to add more insights and make it more comprehensive.

Background auto updates were introduced in WordPress 3.7 in an effort to promote better security. By default it is limited to only minor releases however in special cases WordPress may update your plugins and themes.

If you are one of the millions of websites that are using Yoast WordPress SEO plugin, then your site was automatically updated about a week ago without any notification!

Automatic updates are great for WordPress security because many users never update their plugins or their WordPress installs. However it can break your site which we will highlight below.

First let’s take a look at how to disable WordPress auto updates.

Configuring and Disabling Automatic WordPress Updates

The easiest way to do this is by installing and activating Disable Updates Manager plugin.

Go to Settings » Disable Updates Manager to configure your settings.

Disable Updates Manager

Alternatively, you can disable automatic updates in WordPress by adding this line of code in your wp-config.php file:

define( 'WP_AUTO_UPDATE_CORE', false );

This will disable all automatic WordPress updates.

However if you want to receive minor core updates, but disable theme and plugin updates, then you can do so by adding the following filters in your theme’s functions.php file or in a site-specific plugin.

Disable automatic WordPress plugin updates:

add_filter( 'auto_update_plugin', '__return_false' );

Disable automatic WordPress theme updates:

add_filter( 'auto_update_theme', '__return_false' );

Now that you know how to disable automatic updates in WordPress, the question is should you disable it?

On our sites, we have disabled automatic plugin and theme updates while keeping the minor core updates enabled.

We are listing the pros and cons of automatic updates below to help you make the decision that’s best for you.

Pros

You don’t have to worry about updating minor WordPress releases which are pushed out for maintenance and security purposes.

This is something that you only got if you paid for managed WordPress hosting, but now it’s available for everyone (at least for minor releases).

You also have the benefit of knowing that if there was a crucial security issue with WordPress or a popular plugin, then WordPress will automatically update even if you are on a vacation, so your site is secure.

Cons

There is a slight chance that automatic updates can break your site. In our experience, the minor releases haven’t broken any of our sites yet.

But that’s because we are following the best practices and not modifying any core files. If you modify WordPress core files, then these automatic updates can override them.

Although it hasn’t happened yet, but if WordPress ever felt necessary to push a security update for a theme you are using, then there is a chance that it will break your website specially if you have modified your theme files.

Similar to that, automatic plugin updates can break your site as well because there are just too many variables (different server environments, plugin combinations, etc).

Now it’s important to know that these updates will not break majority of websites, but considering WordPress powers millions of websites, a small percentage can still be a lot of sites.

For example, the recent Yoast SEO update broke two of our sites: WPBeginner and ThemeLab.

On WPBeginner, the issue was very edge-case. For some odd reason, our permalinks broke. That meant every page except our homepage was returning a 404 error. One of our users reported it, and we fixed it fairly fast. All we had to do was go to Settings » Permalinks and click Save Settings to rebuild permalinks.

WPBeginner Broken Permalinks

On ThemeLab, Yoast SEO was deactivated without our knowledge. Apparently when the auto update happened something went wrong with the process which caused the plugin to deactivate.

Since this was such a subtle change which didn’t affect the site’s functionality, we didn’t catch it for a few days. Yoast SEO is crucial for search engine optimization because it handles your meta information, sitemaps, etc. All of that functionality was gone.

Google Webmaster Tools was showing a sitemap error because our sitemap URL now returned a 404.

Sitemap 404 Error

Worst, our broken meta titles started being indexed which we are not sure how long it will take to recover from.

ThemeLab Search Results

This issue was reported by several users in the comments of Yoast’ blog post.

Yoast Comments

The worst part about this update was that the core team did not communicate with site-owners. So there is a very good chance that some people haven’t even realized that their SEO is at risk because of a security update that possibly deactivated their main SEO plugin.

Final Thoughts

WordPress automatic updates for core is new, and automatic security updates for plugins has only been done TWICE … ever!

Normally when WordPress core updates, there is an announcement that follows with it.

However with the past two automatic plugin updates, we haven’t seen a blog post or an email from WordPress.

We fully support the efforts of improving security, but site owners should be notified of every change that is made to their site.

It would be nice to have the WordPress team send an email when they push out security updates to a plugin. Also there should be a way to notify the site owner if the update wasn’t successful, so they can fix the issues as soon as possible.

We hope that there is better communication and more transparency in these security updates in the future.

What are your thoughts automatic updates? Would you keep them enabled or use the above method to disable them? Let us know by leaving a comment below.

To leave a comment please visit How to Disable Automatic Updates in WordPress on WPBeginner.

]]>
http://www.wpbeginner.com/wp-tutorials/how-to-disable-automatic-updates-in-wordpress/feed/ 73
How to Create a Wiki Knowledge Base Using WordPress http://www.wpbeginner.com/wp-tutorials/how-to-create-a-wiki-knowledge-base-using-wordpress/ http://www.wpbeginner.com/wp-tutorials/how-to-create-a-wiki-knowledge-base-using-wordpress/#comments Wed, 18 Mar 2015 12:00:18 +0000 http://www.wpbeginner.com/?p=22772 Are you looking to add a support / documentation section to your site? Want to know the best way to add a wiki knowledge base to your WordPress site? In this article, we will show you how to create a wiki knowledge base in WordPress.… Read More »

To leave a comment please visit How to Create a Wiki Knowledge Base Using WordPress on WPBeginner.

]]>
Are you looking to add a support / documentation section to your site? Want to know the best way to add a wiki knowledge base to your WordPress site? In this article, we will show you how to create a wiki knowledge base in WordPress.

Business Learning and Support

There are three different ways you can build a wiki site within WordPress:

  • You can use a dedicated WordPress wiki theme to build your knowledge base.
  • You can use a dedicated WordPress wiki plugin to build your knowledge base.
  • You can use some custom code snippets to build your knowledge base.

Now there are pros and cons to each method. But don’t worry, we will explain each of them, so you can make the right choice.

WordPress Wiki & Knowledge Base Theme Method

KnowHow - WordPress Knowledge Base Theme

One of the easiest way to build a wiki is to use a WordPress wiki knowledge base theme. There are tons of them available, but we recommend KnowHow Theme.

The best way to setup is to install WordPress on a subdomain or directory like support.yoursite.com or yoursite.com/knowledgebase/

Once done, you just need to install and activate the KnowHow theme and it will work out of the box.

KnowHow Preview

The biggest downside of using any WordPress Wiki & Knowledge Base theme is that you cannot use them on your main site. You have to do the setup on a subdomain or directory because these themes do not really match your branding, and you definitely do not want your homepage to be a wiki.

However many sites have their knowledge base on a subdomain, so this is not as bad as it sounds. The decision really comes down to your preference.

WordPress Wiki & Knowledge Base Plugin Method

Knowledge Base Plugin

If you want to add a wiki knowledge base to your existing WordPress site, then the easiest way to do it is by using a WordPress wiki knowledge base plugin. There are several plugins available, but we recommend Knowledge Base by PressApps (Live Demo available).

All you have to do is install and activate the plugin. Once activated, it adds a Knowledge Base tab in your WordPress admin area.

Knowledge Base Admin

Knowledge Base is it’s own custom post type with categories and tags which allows you to organize your documentation.

The best part about this is that you can add it on your main site, and it will match your brand style / formatting for the most part. It also comes with public / member only voting system, custom widgets, drag-drop functionality, etc. The downside is that it costs $20.

In our next method, we will show you how you can accomplish all of this for free, but it does involve code.

WordPress Wiki & Knowledge Base Code Snippet Method

Another way to add a wiki knowledge base to your existing WordPress site or even create a dedicated wiki site is to use the code snippet method.

The downside is that you have to copy/paste a little bit of code which can be scary for beginners. The upside is that it gives you more freedom, and it’s completely free unlike the first two options.

We will do our best to give step by step instructions.

Note: Before you start, please create a complete backup of your WordPress site.

First thing you need to do is install and activate the Knowledgebase CPT plugin. This simple plugin creates a custom post type called knowledge_base and a taxonomy called section.

This allows you to easily add your wiki articles and organize them into sections.

Adding knowledge base articles and sections

Once you have a few articles and sections, you would need to display them on your website. This is where you need to deal with a little bit of code.

Start by adding this code snippet into your theme’s functions.php file or a site-specific plugin.

function wpb_knowledgebase() {
	// Get Knowledge Base Sections
	$kb_sections = get_terms('section','orderby=name&hide_empty=0');
	// For each knowledge base section
	foreach ($kb_sections as $section) :
	$return .= '<div class="kb_section">';
	// Display Section Name
	$return .= '<h4 class="kb-section-name"><a href="'. get_term_link( $section ) .'" title="'. $section->name .'" >'. $section->name .'</a></h4><ul class="kb-articles-list">';
	
	// Fetch posts in the section
	$kb_args = array(
		'post_type' => 'knowledge_base',
		'posts_per_page'=>-1,
		'tax_query' => array(
			array(
				'taxonomy' => 'section',
				'terms'    => $section,
			)		,
		),
	);
	
	$the_query = new WP_Query( $kb_args );
		if ( $the_query->have_posts() ) : 
			while ( $the_query->have_posts() ) : $the_query->the_post(); 
				$return .=  '<li class="kb-article-name">';
				$return .=  '<a href="'. get_permalink( $the_post->ID ) .'" rel="bookmark" title="'. get_the_title( $the_post->ID ) .'">'. get_the_title( $the_post->ID ) .'</a>';
				$return .=  '</li>';
	 		endwhile; 
	wp_reset_postdata(); 
		 else : 
	 			$return .= '<p>No Articles Found</p>';
	 	endif; 
	$return .=  '</ul></div>';
	endforeach;
	return $return;
}
// Create shortcode 
add_shortcode('knowledgebase', 'wpb_knowledgebase');

This code lists all the knowledge base articles under the section they were filed in.

Next all you need to do is create a new WordPress page and add [knowledgebase] shortcode inside it. Save your page and preview it.

Plain knowledge base section with no CSS

It looks very plain right now, but we can add some styling to it. You can use this CSS as starting point and then continue editing to match your own colors.

Paste the following code in your theme’s style.css file.

.kb_section {
float: left;
width: 280px;
max-width: 280px;
margin: 10px;
background-color: #f5f5f5;
border: 1px solid #eee;
}
h4.kb-section-name {
background-color: #eee;
margin: 0;
padding: 5px;
}
ul.kb-section-list {
list-style-type: none;
list-style: none;
display: inline;
}	
li.kb-section-name {
list-style-type: none;
display: inline;
}
ul.kb-article-list {
list-style-type: none;
list-style: none;
}	
li.kb-article-name {
list-style-type: none;
}
div.kb_section:nth-of-type(3n+1) {clear:left;}
div.kb_section:nth-of-type(3n+3) {}

This how it looked on our demo site where we are using Twenty Twelve theme.

Styled knowledge base page in WordPress

By default, your sections will be displayed in alphabetical order. However if you want to change the order of sections, then you can do that by installing Custom Taxonomy Order NE plugin. This will allow you to drag-drop your sections in the right order.

That’s all, we hope this article helped you add a Wiki knowledge base section on your WordPress site. You may also want to check out our tutorial on how to add a FAQs section in WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Google+.

To leave a comment please visit How to Create a Wiki Knowledge Base Using WordPress on WPBeginner.

]]>
http://www.wpbeginner.com/wp-tutorials/how-to-create-a-wiki-knowledge-base-using-wordpress/feed/ 5