WordPress.org

Ready to get started?Download WordPress

Forums

OBOX Capital theme - Hard coded slug changes (2 posts)

  1. cdw1709
    Member
    Posted 7 months ago #

    Hi,

    i am currently using the Obox Capital theme for my site and within there is a 'services' template.

    Every time i add a service (e.g IT Repairs) through this template however, it appears like this:

    mydomain.com/services/itrepairs

    I want to change the hardcoded /services/ section so it appears like this:

    mydomain.com/computing/itrepairs

    Currently, there is nowhere in the theme for me to do this as the /services/ bit is hard coded.

    Can anybody offer any advice please, the product forum isnt responding.

    Thanks!

    CDW

  2. vailobox
    Member
    Posted 7 months ago #

    Hello!

    If you have posted in our forum, I have either answered you or we are not seeing your post for some reason. Please always allow at least 24 hours M-F for a response.

    The post type name and post type taxonomy slug must be designated or "hard-coded" into the theme. The permalinks are built from this heirarchy. If you want to change the name of the post-type, you must make several edits to the core of the theme which I cannot walk you through here. Needless to say you would need to change every instance of "services" and "services-category" that you find in the theme files using an HTML editor with a good search function such as Dreamweaver. I strongly recommend you create a child theme that adds a new custom post type insted of editing the core themes files so you can continue to keep the theme updated with the least amount of maintenance and re-edits. There are some plugins that make this easier, such as Custom Post Type UI, however the child theme is the way to go if you simply want to copy the services templates for the layout and change the names.

    http://codex.wordpress.org/Function_Reference/register_post_type

    It is generally a really bad idea to remove the slug completely, but you can do it with rewrite rules. The following offers some advice. Please note we do not provide any support for doing this from a theme standpoint, but others here on the .org forums may be able to assist you.

    http://boyn.es/2013/09/28/stripping-slug-custom-post-types/

    http://wordpress.stackexchange.com/questions/9419/remove-taxonomy-slug-from-a-custom-hierarchical-taxonomy-permalink/

Reply

You must log in to post.

About this Topic