Close

wordpress

Gutenberg is a clunky, horrible mess

Spaketh the troll:

“The only thing laughable here is this smug, horrible take.

That’s what cracks me up.

Gutenberg is a clunky, horrible mess. I can see how the childish building block approach might appeal to an arrogant prick like yourself who believes that every sentence deserves a new line, but to real content creators who actually know how to write, it’s a nightmare. An actual blog, an actual article…something you clearly know nothing about, since you’re committed to this self-congratulatory “I’m smarter than everyone else” drivel you laughably call a blog.

I’m sure you’ll offer up some snarky reply about how it’s for developers and whatnot, forgetting that it’s also about the end-user and content creators. Of course, looking at what you’ve designed here, it’s clear that you don’t really know much about quality content or good design. More’s the pity.

In short, your take is bad, and you should feel bad. Sadly, you won’t. You’ll dismiss this as “hating”, just as you’ve dismissed all the valid criticisms of Gutenberg because, I don’t know, using it makes you feel special, important, and superior? I’m only guessing, but based on the attitude of this post and others you’ve made, I feel it’s a pretty accurate one. But hey, you do you, pal.”

–Troll

Oof!

The lady doth protest too much, methinks!

Anyway, notice how there’s no actual explanations here. No reason why. Just “it’s a clunky mess”. One bumbling line about “every sentences deserves a new line”… as if that has anything to do with Gutenberg.

Anyway, this is when you know you’re on the right track.

When, this is the best someone can up with.

Funniest thing is…

I guarantee this “real content creator” will be typing his blog posts in Gutenberg in less than a year from now. In fact, most of the Gutenberg “haters” will. It’s just how this stuff works.

Although, there probably still IS that one guy using Windows XP.

Anyhoo, t’aint no sweat off this gander’s back.

Keep using that clunky old editor if you like…

With your T9-enabled flip phone…

Riding your horse and buggy “into town ma”…

To pick up some spears and loin cloths…

Ok, ok… I digress.

Anyway, if you ain’t into all this debating and just want to dive into Gutenberg without having to learn “yet another piece of software” all on your own, my new Beginner’s Guide to Gutenberg course will show you everything you need to know.

And, access won’t cost you a buffalo nickel.

Deets on that are here: https://skl.sh/2AQpjNj

Later,

John​​​​​​​

December 9, 2018

Gutenberg is NOT a page builder

This is the mistake everyone keeps making.

I’ve heard it probably a dozen times now.

“As a page builder…”

“Compared to Elementor…”

“If you’ve used Beaver Builder…”

I don’t care what WordPress calls it. What any core committer might say about it… Gutenberg is NOT a page builder. Not yet, anyway. So, if you’re looking at it that way and comparing to other page builders…

Sure, Gutenberg sucks…

As a page builder…

For now.

But, that’s the wrong comparison, IMO.

Instead, think of it as a post editor. And, compare it to the old TinyMCE editor. THAT is what Gutenberg is replacing. And, when you do that… trust me, if you actually USE Gutenberg a little bit.

You’ll go back to the old editor…

And wanna blow chunks.

It’s just not even close.

So, use Elementor…

Or Beaver Builder…

Or Layers…

AND Gutenberg.

That’s how I’m using it.

And, you can throw that nasty TinyMCE editor in the garbage.

In any case, the reality is as a developer and/or a freelancer, your current and future clients are going to be using this thing… whether YOU like it or not. So, you’re gonna have to know how to use it.

If you want an assist…

And, don’t wanna have to figure “yet another” piece of software on your own, I created a crash course on Gutenberg that’ll show you everything you need to know. And, you can get access to it for nothing on SkillShare.

All the deets on the course and how to get no-cost access are here: https://skl.sh/2AQpjNj

Later,

John

P.S. Here’s an early review of the course in case you’re wondering if it’s any good:

“This course is the ‘JIT’! – Just In Time for the release of WordPress 5.0 featuring the new Gutenberg editor. The course is great for all levels of users wanting to get their feets wet and start learning how to use Gutenberg inside of WordPress. John (as always) does a superb job of covering the topic content with enough depth and breadth to let you get in there and make something useful.” — Mark Zup

No-cost access: https://skl.sh/2AQpjNj

December 6, 2018

Gutenberg. The death of WordPress

People crack me up.

I remember when I first showed my mom a smartphone. “What the hell do I need THAT for?” You should see her now. Getting her off Facebook is like trying to get a politician to quit lying.

I remember when Twitter came out.

“This is so stupid. Why would anyone care what I’m doing?”

We see where that went.

And yes, yes… I even remember when the internet came out.

(Old jokes will get you BLOCKED! :D)

There were people who said it’d never be a “thing”.

People are so often horribly, awfully, terribly wrong about technology and what they will and won’t use. Like really, really bad.

Enter WordPress Gutenberg.

People HATE this thing.

Just check out some of these “reviews” on the repository:

“The update NOBODY wanted.”

“This is like hell in WordPress.”

“Please let us keep using Classic Editor!”

You’ve got articles speculating that Gutenberg will be the “death” of WordPress.

Gimme a break.

Funny thing is…

Before Gutenberg, if you ASKED people about the classic editor and TinyMCE… they’d have ranted and raved at you for an hour about how awful it was.

Now, it’s this amazing thing we shouldn’t DARE change.

In any case, my challenge for you and all these people is simple. Use Gutenberg for a week to create all your content in WordPress. Then, switch back to the Classic Editor.

I guarantee you you’ll go, “Eh. This sucks.”

It’s not even close.

So, no.

Gutenberg won’t be the death of WordPress.

In fact, I predict that a few years from now, WordPress will be stronger than ever… in part thanks to Gutenberg. And, we’ll look back at this and wonder why we fought it at all.

But hey… I’m sometimes wrong.

So, we’ll see.

In any case, if you’re ready to just dive in and learn this thing and want a no-look pass, I just launched a new course on Gutenberg. And, you can get access to it for the big double zero over on SkillShare.

All deetsies on that are here: https://skl.sh/2AQpjNj

Later,

Johannes “Gutenberg Ain’t S!@#” Morris

December 5, 2018

NEW COURSE: The Beginner’s Guide to WordPress Gutenberg

If you don’t know…

Gutenberg is the new editing experience for WordPress 5.0 and beyond.

And, it is a drastic shift in how post and page creation works in WordPress… moving from one large block of text in the Classic Editor to small, individual blocks of text and media in Gutenberg.

And, the big thing is… this is only the beginning.

Gutenberg will continue to become more and more apart of WordPress moving into full-site layouts and theming and even, eventually, into the WordPress admin area.

So, if you’re using WordPress and haven’t yet…

It’s time to learn Gutenberg.

Which is why I created this new course.

The goal is to get you up to speed with Gutenberg.

What it is and how to use it…

So, if you’re a content creator, you’re not just prepared for the change, but can push Gutenberg to its limits to create rich content and layouts on our site.

Or, if you’re a WordPress developer, you can get familiar with the concept of “blocks” and how your clients’ editing experience will change so YOU can help prepare and educate them.

In the course, you’ll learn all about the new WordPress “blocks”, creating rich content, the convenience of “reusable blocks” and more.

Plus, we’ll build an entire site from scratch using WordPress Gutenberg.

Best part…

You can get access to the course for nothing over on SkillShare. All the details on getting that no-cost access is here: https://skl.sh/2AQpjNj

Later,

John

P.S. If you’re a Patron, the course is waiting for you here: https://www.patreon.com/posts/course-beginners-23124757

December 4, 2018

Will WordPress Gutenberg Obsolete Plugin Developers?

tldr; No, I don’t think so.

Plugin developers are probably the most insulated from the effects of Gutenberg because it is a visual editor. There’s still plenty plugins can and will do that have ZERO to do with Gutenberg.

Of course, page-builder plugins are on the chopping block.

And, eventually, even theme developers will be forced to deal with Gutenberg as it morphs into a full site-builder.

But, plugin developers are safe, in my opinion.

You will, however, still need to learn Gutenberg. Gutenberg *replaces* the entire default post/page editor. That means, no more meta boxes (as they are today). Those will have to become Gutenberg blocks. There will be some backward-compatibility, but WordPress is strongly recommending you update your plugins. Which, you’d want to do anyway, so they’ll work exactly how you want.

I created a block-building tutorial here. And, if you really want to dig into WordPress development, you can take my full WordPress plugin development course here.

Notes

May 15, 2018

How much PHP experience do you need to be a WordPress developer?

This is a bit tricky, because “be a WordPress developer” is subjective. And, you’ll have know-it-alls throwing around the “you’re not a REAL WordPress developer unless you…”. Followed by their arbitrary and subjective criteria.

I’m gonna go with, “how much PHP do you need to know to build a WordPress plugin?” That’s a bit more objective.

And, in that case, it’s a lot less than you might think.

I can tell you my story, anyway. The first WordPress plugin I built was something I called “CommunityPress”. This was way back in the day before BuddyPress and even Mingle or any of the other community plugins like this.

I had big plans for it, but at the time, all it did was add a simple profile page and a sidebar widget. The widget basically showed logged in/logged out status and when it was clicked would take you to your profile to edit.

Nothing super fancy.

At that time, I knew very little PHP. I knew simple stuff like echo, custom functions, some array stuff. But, I knew quite a bit more about WordPress, it’s hooking system and its built-in functions.

And, with that I was able to build my plugin.

That plugin helped me get a gig with a WordPress company.

And, that company is still my #1 client to this day.

Anecdotal, I know… but I personally believe it’s more important to dig into WordPress and understand it, at first, than it is to be a PHP genius. I know a lot of really good PHP developers who are terrible WordPress developers because they don’t take the time to learn how to do things the “WordPress Way”.

It has a lot there to support you…

And, you should use it when possible.

Of course, the more PHP you know the more advanced WordPress plugins you’ll be able to build. But, counter to what a lot of the snobs say… I think you can get going a lot faster than you might think.

On a side note, it’s funny Quora suggested this question to me today. I just launched a WordPress plugin course where I teach you this stuff. So, serendipitous, I guess. Anyway, if you want to check it out, it’s here. It teaches you things like custom post types, shortcodes, handling form submissions and the like.

Source: My answer on Quora.com here.

February 22, 2018

How to Create a Holiday Sale Landing Page Template

Landing page templates are all the rage. In fact, they are the primary product offered by LeadPages… who doesn’t disclose its revenue figures, but is doing well enough to have recently received $27 million in VC funding.

And, according to the CEO… those revenue figures grew 1000% between 2013 and 2015.

Point is… there’s a huge market for these. And, with the holiday season quickly approaching, these kinds of templates will be in high demand.

Here’s how to build one:

Get the template along all the others I’ve released, exclusive coder training courses and 1000s of lines of example source code as a supporting listener on Patreon. Go here now: http://www.johnmorrisonline.com/patreon

P.S. If you liked the show, give it a like and share with the communities and people you think will benefit. And, you can always find all my tutorials, source code and exclusive courses on Patreon.

August 9, 2016

Why WordPress Doesn’t Suck

Subscribe So You Never Miss An Episode

[saf]

Let me state it plainly…

Using a tool like WordPress is by far the fastest way to jumpstart your web development career, carve out more time and leverage that time to learn new skills so you can get paid even more.

Here’s a perfect example:

“Hey, John. I want to thank you again for your advice on keeping an open mind about CMS’s. I completed an amazing site in 2 days that would have taken me months to build out from scratch. You have no idea how much your videos have helped me get out of my funk in web development. I have two prospective clients just from seeing the site that I built with WordPress. I will most likely continue building out my sites with WordPress while expanding my skillset to create my own themes and plugins. Thanks again man, what you’re doing is freakin awesome. -Dee”

In two days, he built a site that would have personally taken him months to build from scratch. And, as a result now has two prospective clients and likely plenty more to come in the pipeline.

Let me ask you…

Do the “well it has procedural code in it” arguments of the know-it-alls across the web sound as convincing in comparison to Dee’s story? Do you really care all that much?

I mean… sure they might make you feel important…

You might get a moment of feeling self-righteous and “better than everybody else”… but will that put food on the table? Will it pay for your Pokemon Go habit? Will it make your kids proud of you?

Yeah… no.

Still, you have guys like this:

“WP is a nightmare. They are stuck with procedural code because they are victim of their success. Who on earth is writing this stuff ? How can such a number of individuals jump on the wagon and coding this way ? Surely they think they are great developers, and in a sense, you have to be, just to make your way in this awful bowl of spaghettis! I don’t think PHP is to blame here. In 2014, it is now a mature language and fully OO with some great frameworks like Codeigniter or Laravel that match Ruby on Rails. I hate to see our profession stained with this WP infamy, that has spread like a virus on the web. The only problem (and the greatest democratic quality) of PHP is that anyone can code and output something on the screen. But now that their ecosystem is in place, watchagonnado ? We’ll just wait another 5 years and see it fall in oblivion — at last! – Christian”

Honestly, I don’t even believe it.

“Stained with this WP infamy”…

Please.

I think this is all about sounding superior. About pumping up his busted ego to make himself feel important. It’s almost like a weird kind of anti-WordPress virtue-signalling. “I hate WordPress therefore I’m a good coder.”

Go away.

Here’s the thing…

Use whatever tool you want. Or don’t use any. Do whatever you need to do to get the job done in the best way you can and don’t worry one single bit about what clowns like this might say.

This is your life.

Don’t let the fear of these know-it-alls hold you back.

And if you’re smart like Dee…

Keep open-minded to a tool like WordPress. See what you can accomplish by leveraging that tool instead of thinking you have to do everything from scratch. I’m convinced you can start getting paid to code much faster if you do.

And then use your extra time to become a PHP god.

And for those of you who are exceptionally genius… fast-track your career even further by letting someone else download all the WordPress knowledge you need into your brain for you… instead of rummaging blindly in the dark for a scrap here and a scrap there.

Enroll in Brad Hussey’s WordPress course and blast out of the gates of your career like Dee did: http://johnmorrisonline.com/wptheme

You get 40% off until August 1st, 2016 so enroll before you forget and miss out for good.

You’re welcome! 🙂

P.S. If you liked the show, give it a like and share with the communities and people you think will benefit. And, you can always find all my tutorials, source code and exclusive courses on Patreon.

July 20, 2016

The Case Against WordPress

Subscribe to the Podcast

[saf]

Let’s get more into this great debate, shall we?

Thing is…

This is important. There are too many new developers who fall hook, line and sinker for the “roll your own” mantra of the know-it-alls. You know, those devs who tend to greatly over-estimate their skills whilst sitting behind their keyboards… yapping about how everybody else is an idiot (duh) and should RTFM!

And, it can stop you from realizing your dream of coding for a living…

Heh. Not on my watch!

All right, so here’s what I got in response to the last episode of the show:

Whilst people may not be able to rewrite WordPress, websites written from scratch are generally better than a WordPress site because they trim the fat. The whole “tool” thing is BS. Yes you may be able to get a WordPress site out in maybe a day earlier than someone going from scratch (maybe), but a good web developer/”pure coder” will always outperform a tool.

First, I give Tom (who posted this) credit… because while I disagree whole-heartedly with him… he was respectful. No hard feelings… BUT I can’t let this fly.

This is what the roll your own crowd always does.

This is an apples to oranges comparison. He’s comparing building a static website from scratch VS using WordPress.

Well yeah.

That’s probably true… but that’s NOT what I said.

You have to compare apples to apples which I pointed out when I responded to him saying:

If you’re talking about a static website… okay. But I think it was obvious I’m talking about something with the same basic functionality. Your CMS built in a few days or weeks will not outperform something like WordPress. I don’t even think that’s a question.

To which he replied:

I never mentioned CMS, and am clearly not disagreeing with you on that point. I’m saying that its the wrong argument to make. My point is my website written from scratch will outperform the equivalent built in a tool, and at the end of the day, THAT’S what matters to the client.

So, point #1… he conceded that he couldn’t build a CMS from scratch that would rival WordPress. That’s actually all I ever said in my original video and he just conceded that he agreed. Game over.

But, let’s address this static site thing, because I still disagree.

I replied to him with:

Let’s say we are taking about a static site. I can use something like Bootstrap, Skeleton, etc and include only the components I want so there’s no “fat” and get exactly what I want. I’ll do it faster than you writing all that from scratch and the actual code in Bootstrap has been used on millions of sites, poured over by thousands of developers, and supported by a community that includes numerous large tech companies. I’m not convinced that whatever you code from scratch can compete with that.

To which he replied:

Ah, the Bootstrap argument. What about custom design/branding i.e. being original? There’s a reason why companies behind the best sites in the world hire “coders”, and also why they are not WordPress-driven. In saying all of this, however, I understand that your average Joe with a small business will probably be fine with a WordPress site or a Bootstrap theme, and in that regard, I agree with you; I’m speaking entirely from a performance standpoint.

Again, conceding that in the majority of cases I’m probably right.

But, let’s tackle that “best companies in the world hire coders” argument just to have a little fun here.

Here’s a short list of big companies using WordPress:

  • TechCrunch
  • BBC America
  • Official Star Wars Blog
  • Sony Music
  • MTV
  • PlayStation Blog
  • Best Buy
  • Xerox
  • Time
  • The New York Times
  • And a whole bunch more

And Bootstrap, along with being used by sites like HomeDepot.com, CapitalOne.com, AmericanExpress.com, Target, Intuit and more… is used by 12% of all websites.

So yeah… big companies hire coders… to build sites with WordPress and Bootstrap… and other tools.

But all this gets back to my original point…

Tool-builders vs tool-users.

If you really want to code things from scratch… that’s 100% okay. I’m with you. I have that in me too. BUT, you are almost always doing your client who just wants a website a dis-service by “rolling your own”.

You should start building tools. Like WordPress. Like Bootstrap.

That’s where the “roll your own” trend is going. Not in building a website for Bob’s Auto Body.

And, if you’re not stuck on writing all the code yourself… then know that you can probably get your web development career going much faster by picking then mastering one of the many tools that’s out there.

You DO NOT need to build everything from scratch.

As one YouTube commenter put it:

I’ve been building sites since 1997. Coding in Notepad and other, better tools as time went on. I have to say that I agree that even then, clients didn’t care about how it got done, just that it’s done the way they want it done.

Capisce?

Aight… as always be sure to keep my kiddos fed and me cranking out these pearls of wisdom for you by becoming a supporting listener of the show over on Patreon. You’ll also get a slew of dope perks. You can learn more at:http://www.johnmorrisonline.com/patreon.

P.S. If you liked the show, give it a like and share with the communities and people you think will benefit. And, you can always find all my tutorials, podcast episodes and more on johnmorrisonline.com, @jpmorris on Twitter and youtube.com/johnmorrisvideo.

June 6, 2016

Weekly Web Developer Q&A (5/20/2016)

Subscribe to the Podcast

[saf]

It’s once again time for our weekly Q&A. If you sent me a question via email, Twitter, YouTube, Patreon, etc… check below. You may find your answer.

Before, I get into the questions a BIG thank you to everyone supporting the show on Patreon. You are awesome and allow me to keep serving our community. I really appreciate it and I can tell you by the messages I receive on a daily basis that you’re helping change people’s lives. So, thank you!

If you’re not a supporting listener and would like to become one, learn more about what Patreon is and the perks you can get here:

http://www.johnmorrisonline.com/patreon

Aight, onto the questions…

From Patrice on Patreon: I have to build a cooking recipe website. What would this kind of site structure [look like]? One page per recipe? How to classify recipes? Any advice?

So, I think you want to take a step back from the site structure and first think about the data structure. That’s because displaying the information (in any site really) is the more trivial part. Creating, updating, deleting, classifying, etc… those are the parts you really want to think through.

Because if you have those down, grabbing and displaying the data is simple.

Now, there’s always the question of “rolling your own” versus using something existing. In my… ahem… younger days, I was a “roll your own” guy. It’s fun at first but you give yourself a lot of extra work.

And truthfully, I think it’s better for the client for you to use something established.

If it were me, I’d use WordPress and create a custom post type called “recipe” and then use the built-in categories to classify them. That’d take me all of about 10 minutes to set up and then the create, read, update part would be done.

From there, you’d just need to find or build a theme your client liked.

And, chances are you could find and buy one for maybe 50 bucks that they’d be over the moon about, tweak it a bit and they’d have a better site than we could probably build on your own.

The ego won’t like that.

But, if you’re putting the client (not your ego) first… well.

That said, there could be legitimate reasons for rolling your own. Just to learn how to do it is a reasonable one. If you really want to go that route, then go watch this video:

https://www.youtube.com/watch?v=rfecHlJvHIM

It cover how to set up your data and object model and answers your questions with details and a step-by-step process.

Hope that helps!

From Edward on YouTube: I am moderately new what exactly do you mean by [niche]?

A niche is a smaller “part” of a market.

Let’s say you’re in the “health” market. There are all sorts of “sub-markets” or interests within that broad umbrella.

Someone could be most interested in bodybuilding…

Or weight loss…

Or longevity…

Maybe they’re an athlete…

Or they have a specific issue like diabetes…

Each one of those groups of people would be after vastly different things even though they’re technically in the same “market”.

Same with tech.

Web design is a very broad brush.

Someone could want just a simple static site…

Or a complex social network…

Or a CMS…

Or just a contact form…

Or their site made responsive…

There are all sorts of “sub-markets” under the umbrella of “web design”. And, it’s better for you to pick one and become an expert at it.

You’ll almost always get paid more.

It’s easier to deliver the final product (because you’ve done it 100 times).

And, it’s easier to get jobs as a “specialist” in whatever you pick.

Now, everybody has a little different definition and method for figuring out what niches exist within a market and which one is right for them.

Here’s mine.

You always want to start with an end result.

That’s because clients don’t care about what languages you use and all that. They care about THEIR end product. Their membership site. Their contact form. Their social network… etc.

These things are all end products.

Not vague ideas or languages like “PHP” or “jQuery” which don’t really mean much to them. “Contact form” means something. And, it’s tangible. They can see it and use it when it’s built.

So, that’s where to start.

What end product will/can/do you want to deliver?

Next and finally is WHO is it for.

For example, in the “health” market… let’s say you want to teach people how to eat in a way that they’re always ketogenic and burning fat. (This is kind of a thing right now in the health market.)

But, let’s say you have a special affinity for body-builders.

Your niche would be something like: “ketogenic diets for body-builders” or “fat-burning” for bodybuilders.

And the process might be a bit different for them versus everyone else since they a) have different goals and b) likely work out for hours a day.

So, you’d teach them differently.

And because maybe you’re a body-builder yourself, you can relate better to them. And, you have some unique methods that work specifically for them. Etc, etc.

So, this is what you want to do in your tech work.

Your niche could be…

Membership sites for new online business owners…

Contact forms for high-traffic websites…

Social networks for niche interests…

It’s WHAT you’re going to deliver and WHO you’re going to deliver it for. Don’t fall into the trap of saying, “but my stuff is for everyone”.

It’s like John Lennon said:

“Trying to please everybody is impossible – if you did that, you’d end up in the middle with nobody liking you. You’ve just got to make the decision about what you think is your best, and do it.”

Aight, that’s quite a bit for one day so we’ll wrap it up there.

If YOU have a question, you can send it via email to john@johnmorrisonline.com, tweet me @jpmorris on Twitter or leave me a comment on YouTube.

(Keep in mind, I might not respond to these directly in those places because I collect them up for this Q&A. Also Patreon supporters get priority access so if you want to make sure you get your question answered, consider becoming a supporting listener.)

P.S. If you liked the show, give it a like and share with the communities and people you think will benefit. And, you can always find all my tutorials, podcast episodes and more on johnmorrisonline.com, @jpmorris on Twitter and youtube.com/johnmorrisvideo.

May 22, 2016

[Periscope] How do I create a multilingual website using PHP?

In this week’s WebDev Q&A, I answer questions on:

  • How do I create a multi-lingual website using PHP? 
  • What about SEO is important to learn for developers? Who should I follow for SEO?
  • How do you create a site key for hashing passwords in PHP?

Watch below:

Links mentioned in the video:

If you get value from this video, please consider sharing it with another developer or group who could benefit from it.

November 17, 2015

[Periscope] Do I Need to Learn WordPress?

In this week’s WebDev Q&A, I answer questions on:

  • What text editor do you use? Why?
  • Can I make my whole living as a web developer?
  • Where’s the source code?
  • Do I need to learn how to use a CMS, like WordPress?
  • What’s the right learning path to take?

Watch below:

Links mentioned in the video:

If you get value from this video, please consider sharing it with another developer or group who could benefit from it.

November 10, 2015

jQuery Tutorial: AJAX Load Content With No Page Refresh

Here’s how to load content into a div on click using the AJAX load method:

Here’s the code I used in the video:

<h1>About</h1>
<p>This is the about page</p>

<h1>Home</h1>
<p>This is the home page</p>

<DOCTYPE html>
<html>
<head>
<title>Load a Page With AJAX and No Refresh</title>
<style>
#nav ul {
overflow: hidden;
margin: 0;
padding: 0;
list-style-type: none;
}
#nav ul li {
float: left;
}
#nav ul li a {
display: inline-block;
padding: 10px 15px;
}
#content {
padding: 15px;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script>
$(document).ready(function(){
// Set trigger and container variables
var trigger = $('#nav ul li a'),
container = $('#content');

// Fire on click
trigger.on('click', function(){
// Set $this for re-use. Set target from data attribute
var $this = $(this),
target = $this.data('target');

// Load target page into container
container.load(target + '.php');

// Stop normal link behavior
return false;
});
});
</script>
</head>
<body>
<nav id="nav">
<ul>
<li><a href="#" data-target="home">Home</a></li>
<li><a href="#" data-target="about">About</a></li>
</ul>
</nav>
<div id="content">
<?php include('home.php'); ?>
</div>
</body>
</html>

If you get value from this code snippet, please consider sharing it with another developer or group who could benefit from it.

July 23, 2015

Build a Grid Layout For WordPress Using WP_Query

Here’s how to build a grid layout for WordPress via shortcodes and WP_Query:

A lot of WordPress developers immediately rush to query_posts in order to create custom loops.

But, query_posts is meant for altering the main loop of a WordPress page/post (actually, it’s not even recommended for that anymore).

Using get_posts() is okay… but, if you want that real WordPress flavor using WP_Query is the way to go.

In the video above, I show you how to use WP_Query to create a custom loop inside WordPress in order to build a Pinterest-style grid layout.

Here’s the code I used in the video:

<?php
/*
Plugin Name: John Morris Grid
Plugin URI: http://johnmorrisonline.com/
Description: Demo plugin that displays posts in a grid format via shortcode
Version: 1.0.1
Author: John Morris
Author URI: http://johnmorrisonline.com
Text Domain: johnmorris-grid
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Domain Path: /lang
*/

if ( ! class_exists( 'John_Morris_Grid' ) ) {
class John_Morris_Grid {
/**
* Init
*
* Initializes the plugin
*/
public function init() {
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue' ) );
add_image_size( 'jmogrid', 220, 220, true );
add_shortcode( 'jmogrid', array( $this, 'shortcode_handler' ) );
}

/**
* Enqueue Scripts and Styles
*
* Enqueues styles and scripts used throughout the plugin
*/
public function enqueue() {
wp_enqueue_style('jmogrid', plugins_url( '/css/style.css', __FILE__) );
}

/**
* Shortcode Handler
*
* Handles shortcode processing
*/
public function shortcode_handler($atts) {
$atts = shortcode_atts(
array(
'posts_per_page' => 100
), $atts, 'jmogrid'
);

return $this->grid($atts);
}

/**
* Grid Builder
*
* Builds the grid
*
* @param array $args Query argumenst passed to WP_Query
*
* @return string $html The HTML output
*/
public function grid($args) {
$grid = new WP_Query($args);

ob_start(); ?>

<div id="jmogrid">

<?php $count = 1; if ( $grid->have_posts() ) : while( $grid->have_posts() ) : $grid->the_post(); ?>
<?php
$modulus = $count % 5;

if ( $modulus == 1 ) {
$class = 'first';
} elseif ( $modulus == 0 ) {
$class = 'last';
}
?>
<div class="jmogrid-item <?php echo $class; ?>">
<?php if ( has_post_thumbnail() ) : ?>
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail('jmogrid'); ?>
</a>
<?php endif; ?>
<h4>
<a href="<?php the_permalink(); ?>"><?php echo wp_trim_words(get_the_title(), 6); ?></a>
</h4>
<p class="jmogrid-meta">
<?php _e( 'Written by', 'johnmorris-grid' ); ?> <?php the_author(); ?><br />
<?php echo get_the_date( get_option( 'date_format' ) ); ?>
</p>
<p><?php echo wp_trim_words( get_the_content(), 10); ?></p>
</div>

<?php unset($class); $count++; endwhile; wp_reset_postdata(); endif; ?>

</div>

<?php return ob_get_clean();
}
}

// Instantiate Class
$JohnMorrisGrid = new John_Morris_Grid;

// Hook in
add_action( 'init', array( $JohnMorrisGrid, 'init' ) );
}

/* John Morris Grid CSS */

#jmogrid {
overflow: hidden;
clear: both;
}

.jmogrid-item {
overflow: hidden;
box-sizing: border-box;
width: 18%;
float: left;
margin: 20px 1%;
border: 1px solid #e4e4e4;
border-radius: 3px;
}

.jmogrid-item.first {
width: 19%;
margin-left: 0;
}

.jmogrid-item.last {
width: 19%;
margin-right: 0;
}

.jmogrid-item h4,
.jmogrid-item p {
margin: 0;
padding: 20px;
}

.jmogrid-item h4 {
padding-bottom: 0;
}

.jmogrid-item p {
font-size: 1.5rem;
}

p.jmogrid-meta {
font-size: 1.2rem;
color: #777;
padding-bottom:0;
padding-top: 5px;
}

If you get value from this code snippet, please consider sharing it with another developer or group who could benefit from it.

July 16, 2015

What WordPress Theme Should Developers Use?

I used the wrong WordPress theme for about 3 years and it made my life miserable. Finally, I switched it up and have never looked back. Here’s what I learned. Watch this, then check the full episode on YouTube.

What WordPress Theme Should Developers Use?

I used the wrong WordPress theme for about 3 years and it made my life miserable. Finally, I switched it up and have never looked back. Here's what I learned. Watch this, then check the full episode in the comments. #wordpress

Posted by John Morris on Tuesday, April 14, 2015

April 14, 2015

WordPress Plugins Are Dead

iOS and Android have forever changed what people expect from their technology. For the most part, however, that wave of expectations hasn’t hit the WordPress community.

Sure, WordPress itself functions a lot like iOS and Android in a platform/app context… But, most of its plugins don’t.

That is changing.

And, in this new world… you’re either a plaform or an app… but you’re NEVER a plugin.

App vs Platform

iOS is a platform. Android is a platform. WordPress is a platform. Evernote is an app. Gmail is an app. SmartS3 is an app. Platforms are the operating system. Apps are the software that run on them.

And, what’s changing (where you need to be headed if develop a WordPress plugin) is users are beginning to expect your app (plugin) to be a platform.

We see a lot of plugins in WordPress. What we don’t see a lot of is plugins that have their own plugins.

The main difference between a platform and an app is how much of an infrastructure is in place for your software to be developed on top of.

We’ve seen some of this with WooThemes and what they’re doing with WooDojo. We’ve seen some with Gravity Forms and their “apps” market.

But, they’re few and far between… and the ones that exist are just in the early stages of development.

It’s not just about what “hooks” you have in your plugin. That is important (it NEEDS to be there)… but it’s also about:

  • What kind of delivery system do you have in place to deliver apps developed on your platform?
  • What kind of support do you offer developers?
  • Have you created a marketplace for developers to sell apps in an integrated way?
  • Do you have the back-end infrastructure in place to support all of this and make it easy for customers to use?

Who would you rather be? Apple selling millions of its platform largely due to its apps… earning a piece of the pie for every app sold on its platform or the app-maker earning solely based on what you yourself can develop?

Even more… and this is so absolutely critical to get… in a community like WordPress’ where many plugin authors are in direct competition with one another, do you think you can continue to stay viable when your competitors are thinking like Apple and you’re still thinking like Doodle Jump?

Not a “there’s always room for everybody” situation… but a you’re in direct competition with someone acting like Apple… building platforms with a full-blown marketplaces behind them… aimed squarely at running you out of business?

Who do you think wins?

What We Should Be Doing

For context, here’s my mindset…

I think of WordPress as a Content Management Platform. WishList Member is a WordPress plugin, but I see it as a Content Monetization Platform.

It sits on top of WordPress and exposes content monetization services to WordPress itself and to the apps developed on top of it.

That’s what our API is for.

But, in our little world, I think we need to go further.

I’ve gone to the point of being annoying about…

  • Integrating WishList Member deeper into WordPress… especially interface-wise.
  • Adding more and more ways for developers to interact with WLM (especially, hooks in our admin interface)
  • Upgrading, testing, re-working, documenting, etc our API.

All of this will become critical with what comes next. What comes next is what makes a plugin a platform whether you like it or not. What comes next is what makes it almost impossible for a competitor to beat you.

What comes next is what premium WordPress plugins 5-10 years from now will HAVE to be in order to even compete… let alone win.

So, what comes next?

July 12, 2013

7 Reasons Why You Should Start Using the Official Facebook for WordPress Plugin (and 3 Reasons Why You Shouldn’t)

Facebook just launched its official WordPress plugin which allows you to “easily” integrate Facebook features into your WordPress website.

I’ve spent the last day or so playing around with it and here’s my initial thoughts.

Why You Should Install Facebook for WordPress

1. Easy connection to your Facebook account. If you’ve ever setup one of the many Facebook plugins for WordPress, you’ll know that you typically have to create a new application in Facebook, grab the API Key and API Secret from your app, and paste them into your plugin.

This plugin is no different, except you only need to do it once and it gives you access to several of Facebook’s social plugins. Having an integrated Facebook plugin like this keeps you from having to create multiple Facebook applications for a bunch of different plugins or a bunch of PHP coding… which is very handy.

(more…)

June 13, 2012