WordPress 4.0, What You Need to Know

wordpress-4.0-benny
WordPress 4.0 “Benny” is now officially out and available for download.

As with every major WordPress release it’s a good idea to first get a glimpse at all the new features added to make sure you use them at full potential.

In that sense here’s what you need to know about WordPress 4.0:

Read more

Profile Builder 2.0 is Coming! Sneak peak at New Features & Enhancements

Profile Builder is about to get even better. The past couple of months we’ve been working hard to improve and extend its functionality.

profile-builder-2.0-logo
Most of the architecture and UI of the plugin has been rebuilt from scratch for increased usability, focusing on the most essential tasks you would need from an all in one user registration and management plugin.

Since the official release is approaching soon, we thought we’d give you a sneak peak at some of the new things in Profile Builder 2.0.

Read more

WordPress has_term Conditional Tag Shortcode

has_term checks if the current post has any of given terms. The first parameter can be an empty string. It expects a taxonomy slug/name as a second parameter and you can also pass a post ID or object as the third parameter.

It can be useful if you need to list a different message or apply a different css class to your post.

However, if you want to use this inside your content, it won’t work simply because you don’t run PHP code inside the WordPress content area.

has_term shortcode

This is where a simple shortcode can come a long way.

It’s a simple mapping of the has_term conditional tag to the [has-term] shortcode.
It gives you access to:

  • [has-term term="term-name" taxonomy="tax-name" value="true" id=""]
        List this if post has term-name
    [/has-term]
  • [has-term term="term-name" taxonomy="tax-name" value="false" id=""]
        List this if post doesn’t have term-name
    [/has-term]
<?php
/*
Plugin Name: WCK - Conditional Shortcode Based on has_term
Plugin URI: http://www.cozmoslabs.com
Description: Gives you access to the [has-term term="term-name" taxonomy="tax-name" value="true" id=""] List this if post has term-name [/has-term]  AND [has-term term="term-name" taxonomy="tax-name" value="false" id=""] List this if post doesn't have term-name [/has-term]
Author: Cristian Antohe
Version: 0.1
Author URI: http://www.cozmoslabs.com
*/
add_shortcode( 'has-term', 'wck_has_term_shortcode' );
function wck_has_term_shortcode( $atts, $content = false ){
	extract(
		shortcode_atts(	array( 'term' => '', 'taxonomy' => '', 'value' => true, 'id' => null,  ), $atts )
	);	
 
	if ( $value === 'true' ) $value = true;
	if ( $value === 'false' ) $value = false;
 
	if ( !$content || $term == '' || $taxonomy == '' ){
		return;
	}
 
	if ( has_term( $term, $taxonomy, $id ) && $value ){ 
		return $content;
	} elseif ( !has_term( $term, $taxonomy, $id ) && !$value ) {
		return $content;
	} else {
		return;
	}
}

You can also download it from here: Has Term Shortcode Plugin

Limitations

Currently there is no support for multiple term names to be passed inside term=”term-name” (similar to the actual has_term function), although that should be easy enough to implement in the plugin if you want to.

WordPress Creation Kit 2.0.6 and WordPress 3.9

Due to an overconfidence on our part regarding WordPress updates and compatibility issues with our plugins, we failed to test WordPress Creation Kit 2.0.5 with WordPress 3.9 before the official launch of WordPress 3.9.

We are sorry. We should have known better and we will make a habit out of testing our plugins with future versions of WordPress before they are released.

WYSIWYG Bug

Since WP 3.9 updated TinyMCE to the latest version (v.4) and our WYSIWYG editor was still using v.3, trying to initiate the two together causes JavaScript errors and the WordPress Editor and our own WYSIWYG Editor stopped working.

Also, due to the way WordPress loads TinyMCE v.4, we’re not able to use it any longer for our own WYSIWYG editor (the main reasons it took us a full day to issue the update). That is the reason why from version WCK 2.0.6 we’ve switched to CKEditor for the WCK WYSIWYG editor.

You can download the latest version of WordPress Creation Kit from:

  • wordpress.org
  • Your Account page
  • Or wait for an automatic update to be available for both the Free or the Pro, Hobbyist & Lifetime versions

New improvements in WCK 2.0.5 and Profile Builder 1.3.23

We’ve just released an update for both WordPress Creation Kit and Profile Builder plugins. This update adds a couple of improvements and bug fixes listed below.

WCK 2.0.5

wck-pro-icon

Upload Field now uses the Media Manager added in WP 3.5

WCK 2.0.5 release was focused on improving the upload field as well as fixing the bugs reported by our users.

Now uploading media files via the Upload Field from the back-end or front-end (using WCK Front End Posting) of your WordPress sites will be really straight forward.

Features:

  • Upload Field now uses the media manager added in WP 3.5
  • Added progress icon on forms in WCK Front End Posting
  • Now we prevent “Meta Field” and “Field Title” to be named “content” or “action” in Custom Fields Creator to prevent conflicts with existing WordPress Fields

Hotfixes/Bugfixes:

  • Fixed bug in Front End Posting where a filter for posts_where wasn’t removed correctly
  • Fixed bug in Custom Fields Creator that didn’t display “0” values
  • Fixed bug in Front End Posting that didn’t display the right values if the Taxonomy had the label “Categories” (regardless of it’s slug). Now it won’t list the default Categories in WP.

Profile Builder 1.3.23

pb_pro_icon

Profile Builder 1.3.23 is a minor update focused on improving the Admin Approval performance when dealing with large number of users.

We also fixed existing bugs related to the hidden input field and “Remember me” checkbox that wasn’t displaying correctly on the Login page.

Improvements/Bugfixes:

  • Improved Admin Approval performance for large number of users
  • Fixed hidden input field on front-end
  • Fixed “Remember me” checkbox on the Login page

*The latest versions of WCK and PB will be available via automatic updates or you can download them from your account page.

If you’re new to Profile Builder or WordPress Creation Kit, there is a fully functional FREE version you can play with to get a feel of how they can help with your next WordPress project.

Show Custom Fields in WordPress

Show Custom Fields in Theme

How to show custom fields in WordPress is one of the hardest thing to understand by non-technical users.

By default, WordPress gives you the possibility to add custom fields directly from the UI.

There are also a lot of plugins that let you add advanced custom fields like inputs, check-boxes, selects, etc.

However, almost all of those solutions fall short when it comes when you want to show custom fields in your template.

Show Custom Fields Using Code

The default way to show custom fields in WordPress would be to:

  1. Open the single.php or page.php template file from your theme (via FTP or locally)
  2. Find the_content function so you can list your custom fields after the actual content of the post or page
  3. Use the get_post_meta function to list custom fields

It doesn’t sound to complicated, but you’ve lost a non-technical user at opening single.php

This is how your page.php could look if you wanted to show two custom fields, book title and book ISBN code.

< ?php
/**
 * The template for displaying all pages
 *
 * This is the template that displays all pages by default.
 * @subpackage Twenty_Thirteen
 */
 
get_header(); ?>
 
	<div id="primary" class="content-area">
		<div id="content" class="site-content" role="main">
 
			< ?php /* The loop */ ?>
			< ?php while ( have_posts() ) : the_post(); ?>
 
				<article id="post-<?php the_ID(); ?>" < ?php post_class(); ?>>
					<header class="entry-header">
						<h1 class="entry-title">< ?php the_title(); ?></h1>
					</header><!-- .entry-header -->
 
					<div class="entry-content">
						< ?php the_content(); ?>
 
<!-- Let's show our custom fields here -->						
 
< ?php 
 
	$my_book_title = get_post_meta( get_the_ID(), 'book_title', true);
	$my_book_isbn = get_post_meta( get_the_ID(), 'book_isbn', true);
 
	if( ! empty( $my_book_title ) ) {
		echo '<h3>Book Title: ' . $my_book_title . '<h3>';
		echo '<p>ISBN: ' . $my_book_isbn . '</p>';
	}
 
?>
 
<!-- End showing our custom fields here -->						
						< ?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?>
					</h3></div><!-- .entry-content -->
 
					<footer class="entry-meta">
						< ?php edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '' ); ?>
					</footer><!-- .entry-meta -->
				</article><!-- #post -->
 
				< ?php comments_template(); ?>
			< ?php endwhile; ?>
 
		</div><!-- #content -->
	</div><!-- #primary -->
 
< ?php get_sidebar(); ?>
< ?php get_footer(); ?>

It’s no rocket science and really simple to pull off.

The problem starts when you try to do more complicated stuff, like groups of custom fields (metaboxes), repeaters fields and groups, connect posts using custom fields.

Show custom fields using Swift Templates without code

Listing your custom fields in WordPress is one of the simplest way to transform your website from static pages to a proper CMS. You can use it for:

  • Adding extra information on your posts and pages
  • Showcasing your team
  • Listing testimonials
  • Simple property listing
  • Custom product pages
  • Custom landing pages
  • Listing company services
  • And pretty much anything that might require some extra information

It’s possible to create all of the above without being a developer in three steps.

Read more

Post to Post Relationships with WCK 2.0.4

A new version of WordPress Creation Kit is now available: 2.0.4 with Post to Post Relationships

post to post relationships

WordPress Post to Post Relationships

In WordPress post types are often in a relationship of some sort. For example, you might want to relate a soccer player to a team. You could do it with taxonomies, but it can become cumbersome and it won’t really do what you wanted it to do.

I wanted to use a post to post relationship in my project using other plugins, but I got really stuck when I tried to integrate those in my theme! I’m really not a programmer.

Truth is, post to post relationship plugins have been around for quite some time. The CPT Select field in WCK quite some time ago, but to really make use of it you had to open up your editor and start getting really good at WP_Query.

Read more

The easy way to create a WordPress Team Page

Call it “Meet the Team”, “Our Team” or “Staff List”, a WordPress Team Page is a pretty standard request when building a new website. That’s probably because everyone wants to know the people behind a specific project. It ads a personal touch to the company and can lend trust to visitors.

Even though there are many ways to go about building a WordPress Team Page, in this tutorial we’re going to focus on making it simple (easy to build) and intuitive (easy to update by clients – mostly non-technical users).

Let’s consider the following scenario:

  • we want to have a variable number of team members
  • it needs to be easy to add, remove or rearrange team members
  • to make it easy to update we’ll need specific fields for team members, like: Name, Title, Bio, Picture, Social Media links etc.

Now here comes the best part. It would be great if we can achieve all of this with a couple of clicks from the WordPress admin UI and without writing a single line of PHP code.

Read more

WordPress 3.8 – The Best Redesign Since Ever?

WordPress 3.8 is just around the corner and I can honestly say it’s THE most exciting release since ever! With the WordPress 3.8 RC2 available for download, we’re only days away from the excellently polished WordPress 3.8 UI.

Much more than just a new skin

You can see by the title of this post that I’m quite excited about this release. The old design has been around since 2.7 with only minor improvements across the board (was back in 11’th of December 2008 when 2.7 was launched, 5 years ago!). While the new, WordPress 3.8 UI, keeps most of the elements in the same place, it’s clearly the biggest thing to happen visually in the last 5 years.

WordPress 3.8 UI is stunning to look at and work with, but it also represents the best responsive/mobile implementation we’ve seen for the WordPress backend so far:

  • the top and sidebar menus have been re-envisioned for small resolutions
  • the sidemenu is now hidden by default and can be much more easily extended on small devices.
  • the Add New Post works wonderful for resolutions under 600px
  • every button and link is just a little bit larger, so you can tap them even if you have big thumbs
  • comes with its own flat vector icon font for the admin UI, called dashicons
  • it’s not just a refined implementation of what was before, it was created with devices of all sizes in mind

mobile

Read more

WordPress Creation Kit Video

WordPress Creation Kit helps you develop intuitive WordPress sites, easily manageable by your clients, in half the time and without writing a single line of PHP code.

However, this is somewhat hard to visualize, so to that end we created a WordPress Creation Kit video explaining:

  • what is WCK
  • what you can do with it, in a tutorial like structure.
  • walking through almost all of the modules inside WCK

I tried to keep it as short as possible so consider this as a basic introduction.

Also we have MORE videos planned in the future, so if you have suggestions or thoughts you want to share, now is the time!