By Indie Authors for Indie Authors.

Author: Victor Davis (Page 2 of 4)

Creating Shortcodes

  1. WordPress Plugins for Writers
  2. The WP Post Series Plugin
  3. The EZ Columns Plugin
  4. MyBookTable Plugin
  5. Embed PDF Plugin
  6. Easy Digital Downloads Plugin
  7. Media File Manager Plugin
  8. Folder Gallery Plugin
  9. Managing Links
  10. Creating Shortcodes
  11. Mailchimp: A Pandora’s Box
  12. Getting Social
  13. Dropbox Backup

 

Now it is time to dive into another technical plugin and help you understand how plugins work at an operational level. What is a shortcode? A shortcode is a symbol or marker that gets replaced by html code during the rendering of a wordpress page. Here is a typical example. At some point on your webpage, you have probably added a standard contact form. If you insert one, then switch from the “visual” to the “text” tab, you’ll see something like this:

 

1

 

 

This is the shortcode for the contact me form. Not so short, you think? Then compare it to the html code that takes its place when the page renders:

 

2

 

 

So you see, even though the shortcode might still look like computer code, it’s minimal compared to real computer code, it’s code you can actually type and work with. That’s the beauty of wordpress: all the complexity is hidden and a minimal amount of control is left to you to configure a working site.

If this intro hasn’t frightened you away, I strongly encourage you to stick with me as I teach you how to create your own custom shortcodes. If you’re on the fence, scroll to the bottom and see a really cool trick you’ll be able to do after wading through the geeky mumbojumbo. First, install the Shortcoder Plugin. Let’s start with something simple. There may be a page or a series of pages that you want to have a common footer, kind of like an email signature, and you’ve copy-pasted something over and over again. For example, on each of my download pages, I have the following icons & message. Looks nice, but I have over twenty download pages, and I was copy/pasting this footer each time.

3

 

Go to Settings > Shortcoder and you will see something beautiful. It’s exactly the message you see at the bottom of each of my downloads pages. So the plugin allows me to create it once, then reference it in any page I want. Any changes I make to this centrally maintained code is reflected on every page.

 

4

 

 

Here is what I put at the bottom of each download page. (Notice above where it says “your shortcode is.”)

5

 

WordPress, as it renders each page, scans for this shortcode and replaces it with the message stored in the settings. That’s the concept. Now let me show you something truly cool. Shortcodes are more than just placeholders, they are also customizable. Take another look at my download page. See the goodreads reviews at the bottom? Wouldn’t you love to add this little widget to your book pages?? Here’s how I did it. At the bottom of each download page there appears the following shortcode:

 

6

 

 

Notice that in addition to the shortcode itself, there are three parameters: the book’s goodreads id, isbn, and title. Going back to Settings > Shortcoder, here’s how the plugin manages those parameters:

 

7

 

 

As wordpress renders the page, it looks out for this goodreads shortcode, and replaces each instance of it with the above code. But it also replaces each instance of %%id%% within that code with the book’s goodreads id. For those of you who don’t read html (we are writers after all, not coders), what this snippet of code does is insert a frame which goodreads fills with all the reviews for your book as they appear on your book’s goodreads page. I don’t expect you to type all that, after all, I copy/pasted it myself out of goodreads’ developer area. I can’t post it directly here because this website is itself a wordpress site which will try to render the code rather than just display it, so click here to access a copy for yourself. Please note though, that buried in the code is a place for “developer id.” No, you do not have to register as a goodreads developer in order for this to work, but keep in mind that like any other big site, if you use their tools without registering, they’ll throttle you after so many tens of thousands of clicks. Here is the final result, tailored to each individual book:

 

8

 

The power of this one little plugin is so awesome, you can just about use it to create your very own plugins. If you have any questions about shortcodes, please contact me.

 

Find more writing and publishing tips at Nothing Any Good.

 

 

Victor Davis is the author of one short story collection, Grains of Sand, and is publishing a second book, The Gingerbread Collection, in the spring of 2016. He shares his writing and reading adventures at his blog Mediascover. You can find him on FacebookTwitter, and Goodreads. His Books & Stories are available on AmazonApple iBooksSmashwords, and Barnes & Noble.

 

Managing Links

  1. WordPress Plugins for Writers
  2. The WP Post Series Plugin
  3. The EZ Columns Plugin
  4. MyBookTable Plugin
  5. Embed PDF Plugin
  6. Easy Digital Downloads Plugin
  7. Media File Manager Plugin
  8. Folder Gallery Plugin
  9. Managing Links
  10. Creating Shortcodes
  11. Mailchimp: A Pandora’s Box
  12. Getting Social
  13. Dropbox Backup
Wordpress for Authors

Photo Courtesy of WordPress for Beginners

It might be worth mentioning at this point an important fact about WordPress plugins. If you’ve been following this post series you might be getting excited and carried away by the many possibilities discussed. Keep in the back of your mind that plugins slow your site down. The more you have activated, the slower your site will run.

The reason is that each plugin consists of extra code that must run in order to render the page correctly. If you have twenty plugins activated, then twenty sets of code must run, each plugin demanding its round-robin piece of computation time to make sure it’s performing properly. Whenever you see a plugin advertising itself as “lightweight,” that’s tech speak for very little code, thus very little added load time.

Broken Link Checker

The Broken Link Checker is a great plugin that you can install and run periodically. It will search your site and check every link and report back to you any broken links that need to be repaired or removed.

As you know, it dents your credibility for a link on your site to come up with an error. External links are forgivable, since your reader knows you might have linked some content that has since disappeared through no fault of your own.

If there are any internal broken links, that makes you look much worse. Avoid them all by sweeping for them from time to time and fixing even very old posts. Per the caveat above, this is exactly the kind of plugin that is indispensable, but doesn’t have to be installed and activated 24/7 in order to work for you.

 

Redirection

When I first tried to use WordPress, I didn’t get the concept. I’ve worked as a software developer and built my fair share of websites. So the whole “new page,” “new post” GUI made no sense to me.

To me, a “new page” was an empty notepad file and I got to build it from scratch. WordPress asks you to create content in this tiny little box within your page, while it “takes care of” all the functional parts of the site around your content.

That’s every bit of what you intended to do, but there are a handful of times when you want to display some “naked” or custom content without leaving your site. Redirection allows you to create pages like this one, which looks like “http://mediascover.com/subscribe/” but behind the scenes, redirects you to “http://eepurl.com/bvnWy9” without you knowing.

This is called a “pass-through” redirect, and it is useful for folding special pages into your site without going through WordPress’s theme. The plugin offers other kinds of redirects as well.

 

External Link Checker

Every time you create a link in WordPress, there is a checkbox that says “open link in new tab.” SEO considerations aside, the rule of thumb is to open external links in a new tab so that your website stays open in the original tab, thus the user hasn’t truly yet left your site.

For your own internal links, you want the user to transition from page to page without annoying them with an explosion of new tabs each time. What This Amazing Plugin does is search through the hundreds of links on your blog and find any that violate this rule of thumb so that you can fix them.

The only problem is This Amazing Plugin does not exist. I’ve found dozens of plugins that, when activated, scan the page as the user loads it and make this change, but the change is not saved permanently. What I want is a plugin which, like the Broken Link Checker, I can install & run periodically to catch mishaps without having to leave it permanently activated. If you find such a plugin, or decide to make one on this inspiration, please contact me about it!

 

 

Find more writing and publishing tips at Nothing Any Good.

Victor Davis is the author of one short story collection, Grains of Sand, and is publishing a second book, The Gingerbread Collection, in the spring of 2016. He shares his writing and reading adventures at his blog Mediascover. You can find him on FacebookTwitter, and Goodreads. His Books & Stories are available on AmazonApple iBooksSmashwords, and Barnes & Noble.

Folder Gallery Plugin

  1. WordPress Plugins for Writers
  2. The WP Post Series Plugin
  3. The EZ Columns Plugin
  4. MyBookTable Plugin
  5. Embed PDF Plugin
  6. Easy Digital Downloads Plugin
  7. Media File Manager Plugin
  8. Folder Gallery Plugin
  9. Managing Links
  10. Creating Shortcodes
  11. Mailchimp: A Pandora’s Box
  12. Getting Social
  13. Dropbox Backup

wordpress for writers

 

In order to use this plugin, it is a good idea to first implement the Media File Manager plugin from last week.

Let’s say you want to show a collection of photographs on your site, like a Facebook album. There are plugins that allow you to create galleries by selecting a group of images from a list. If you have many images, this can be cumbersome, and if you have to upload new versions of some of the images, you have to re-add them to the gallery.

The Folder Gallery Plugin allows you to create a gallery by pointing it to a folder. The gallery displays all the images in that folder. Here is an example of the plugin in action:

 

Folder Gallery Plugin

 

At the bottom of the linked page, you will see the images above lined up in neat rows and columns. To create the album, I simply uploaded all the images to a single directory using cPanel File Manager, and used a single line of code in the WordPress post to display them. Notice (below) how it’s simply the “foldergallery” short code with two parameters, and that’s it, dozens of images spill out of that one line!

 

Screenshot from 2016-01-31 20:21:53

 

The plugin takes care of the rest. Importantly, I didn’t even have to go through WordPress’s Media section in order to upload the photos.

However, if you want to make a gallery of photos already existing on your website, see last week’s post to learn how to consolidate a group of scattered files into a single directory.

This plugin also requires what it calls a “Gallery Engine.” This is just the necessary plugin that pulls up a lightbox when you click on each image. Though it’s too simplistic for me to write a separate post about it, I use the Easy Fancybox plugin for this.

 

Find more writing and publishing tips at Nothing Any Good.

Victor Davis is the author of one short story collection, Grains of Sand, and is publishing a second book, The Gingerbread Collection, in the spring of 2016. He shares his writing and reading adventures at his blog Mediascover. You can find him on FacebookTwitter, and Goodreads. His Books & Stories are available on AmazonApple iBooksSmashwords, and Barnes & Noble.

Media File Manager Plugin

  1. WordPress Plugins for Writers
  2. The WP Post Series Plugin
  3. The EZ Columns Plugin
  4. MyBookTable Plugin
  5. Embed PDF Plugin
  6. Easy Digital Downloads Plugin
  7. Media File Manager Plugin
  8. Folder Gallery Plugin
  9. Managing Links
  10. Creating Shortcodes
  11. Mailchimp: A Pandora’s Box
  12. Getting Social
  13. Dropbox Backup

WordPress-PluginsThis is going to be a technical one, but it’s totally worth it in order to use next week’s plugin.

The Media File Manager allows you to move files among the subdirectories of your site. Sound simple? It’s as simple as it should be. One of my biggest complaints about WordPress when I first started using it was the chaotic way in which it stored files in the backend. If I’m leasing server space, and I have access to cPanel’s File Manager, then I should be able to treat it just like I do Dropbox or an external hard drive, and create whatever folder structure makes sense to me for my site.

Suppose, for example, you have several books and you want to store all the book cover images in one place. If you’ve uploaded them all on different days (of course), then wordpress has buried them in a date-based folder scheme such as wp-uploads/2014/08/09/my-cover.jpg.

That makes it nearly impossible to organize yourself later. A year or two down the road, your Media section might contain hundreds of images, from icons to photographs to book covers etc., with no grouping whatsoever.

As this screenshot shows, the Media File Manager plugin allows you to create & delete folders, and move files among them.

 

Screenshot from 2016-01-31 19:49:13

 

Why not do all this from cPanel’s File Manager?

WordPress does not automatically recognize its own subdirectories. If you try to move a file using cPanel you’ll notice that your Media section will act as if nothing happened, and you’ll see an “image not found” error instead of your image. This is because WordPress stores the location of each file in its database. For every change you make in your folder structure, the plugin registers those changes in WordPress’s database behind the scenes.

For example, let’s say down the line you’ve published five books and hired a cover designer to redo each one for a clean, consistent second edition look-and-feel. If all your covers are in one place, then you can use cPanel to upload & overwrite the old with the new and WordPress will never even know you’ve swapped them out.

That’s the non-technical advantage to using technical tools to keep the backend of your site clean and easy to navigate.

 

Find more writing and publishing tips at Nothing Any Good.

Victor Davis is the author of one short story collection, Grains of Sand, and is publishing a second book, The Gingerbread Collection, in the spring of 2016. He shares his writing and reading adventures at his blog Mediascover. You can find him on FacebookTwitter, and Goodreads. His Books & Stories are available on AmazonApple iBooksSmashwords, and Barnes & Noble.

 

« Older posts Newer posts »

© 2022 Nothing Any Good

Theme by Anders NorenUp ↑

Become the Best Writer You Can Be

Discover why Hundreds of Authors subscribe to Dan's newsletter.

Subscribe to learn how he became a #1 Bestselling Author and immediately boost your success as a writer.