How to change the custom post name in our Fest theme

In our Fest WordPress theme we implemented a nice feature which displays a uniquely-styled custom custom post type – speakers. There's also a widget included which can display your speakers, with a rotation animation so everyone get their spot in the sun. In addition to this, we also added a plugin which allows users to change the speakers custom post type name to anything you want. However, though this simplifies the process, we still find that many of our customers have trouble with changing the name, so in this article we’ll tool you up with the resources you need to get started.

How to change the custom post name in our Fest theme

Changing the custom post name

For the sake of this tutorial, we’re going to change the standard “Speakers” custom post name to “Artists”. If you’re starting with the base quickstart installation, then after the install is complete you’ll have a full site with the frontpage, widgets, post content and categories all present and accounted for. From here, we can easily change the name of our speakers, replacing it with our preferred term, “Artists”. To do so, we have to navigate to the Dasboard → Settings → GK Speakers menu option, where we can the settings connected with our custom post type:

GK Speakers Options

Now we’re going to use the information available in the Fest documentation to guide us on making changes. First, we need to change the gavern_speakers custom post name to gavern_artists. Now, we can change each option that uses speaker, such as the label options, to instead use artist. Once done we can save the settings and the Speakers menu in our dashboard should have changed to Artists:

Menu name changed

On the speakers page, there are additional options which allow you to show/hide Comments on a Single Custom page or display a custom post type category in a fullwidth layout.

Now it’s a good idea to resave our permalinks to make sure that they are properly generated because of the custom post type changes; we don’t want any issues with navigation. To do this, we have to go to Dasboard → Settings → Permalinks and, assuming we are sticking with the current permalink structure, just click the save changes button.

What we’ll notice now is that all of our existing speakers are gone, (they are in the database, but we don't have access to them now), so we’ll have to create some artists if we want to get things looking as they should. (Please remember to create at least 6 artists, as the speakers widget needs this amount to ensure it rotates properly.)

So, we create new posts (we can also create new category i.e. Artists), add featured images to create the artist avatar that will be displayed on its single and category pages, and we find that it doesn’t look as good as it did before because the styling has disappeared.

To fix this, we have to head back to the GK Speakers settings page and take a look at some very important information at the bottom of the page:

Rename Theme Files

Let’s fix this. First we save our changes, then we need to rename some files in the Fest directory via FTP:

  • category-speakers.php should be renamed to category-artists.php
  • single-gavern_speakers.php should be renamed renamed to single-gavern_artists.php

So we have to connect to our server via our FTP client of choice, navigate to our wp-content/themes/Fest directory and rename the above files; the file name we need to change to will depend on what custom post name we’ve chosen.

Once this is done the styling is reapplied and everything will look as it should on the single artist and artist category page. That’s it! Thanks for reading, and I hope that this article has helped get that pesky Speakers renamed to your liking in our Fest WordPress theme.

Share
This article was first published November 30th, 2014