It was pretty simple. after going through the wordpress codex,
just had to change the second line on single.php
$categorySlugName = single_cat_title(true);
TO
$cateogrySlugName = get_category_by_slug($slug);
Related Posts:
- 404 Page Not Found for Only One Post
- changing permalink for custom template in posts of a certain category
- 404 error on published page with specific permalink
- “post-name” Renders Using page.php, but “post-name-2” renders with single.php
- How does WordPress create URLs that Apache knows about?
- Hide permalink and preview button and link on custom post
- Adding another word in front of post url
- Custom Post Type: Get most recent permalink
- If permalink is equal to current site url
- How can I add dynamic page url in WordPress?
- How to use author id in post permalink
- Remove parent slug for child pages
- Rewriting permalinks with custom posts
- Make Category Base Appear in Posts Permalink (but not tags)
- Getting a 500 internal server error ONLY on wp-admin/options-permalink.php
- How to Modify Existing Rewrite Rules?
- Top level Pages redirecting to homepage!
- Image Attachment Url Rewrite
- Rewrite Page with a slug before page name
- Permalinks keep reverting to 404 unless I re-save them
- How to hyperlink both post thumnail image and post title text in wordpress?
- Permalinks okay some pages but 404 error on others
- How to add_rewrite_rule with two parameters to a single view page?
- Permalinks for parent/child pages and custom post types
- Automatically append ID to at the end of specific URLs
- remove sub-category of Custom Post Type from permalink structure
- WordPress Permalinks & Nginx Rewrite Rule Not Working
- How to change wordpress category list url
- Need to add trailing slash to all internal links relative and absolute
- wordpress custom post type taxonomy permalink
- Change Permalink of attachment page
- How to rewrite a URL to another rewritten URL without changing the address?
- Update the permalink for one post via wp cli
- How can I make internal anchor links work with WordPress’s permalinks?
- How do I get thumbnail generator to recognize the_permalink tag?
- wordpress how to replace url /bar with foo/bar for custom post type
- Can WP give a value a post ID?
- Page Name and Permalinks
- Getting back a permalink from custom url
- how to get a list of all top level pages
- Permalinks on Windows IIS not working and web.config breaks site – does wordpress not support windows server now, if so how?
- Permalink sub-routing catch-all
- I’ve removed my /author/ slug but it clashes with new and existing pages. Any fixes?
- Exclude single page from permalink rule
- Changing the entire permalink
- How are WordPress Page URLs affected by permalink settings?
- Home page Pagination – Other pages do not redirect to home page template
- How do i get post thumbnail using attachment code
- Access posts while mod_rewrite is broken
- Update page breaks permalinks
- WordPress switch servers
- Browsing to permalink prefix results in 404
- Tag pages do not show
- WordPress Posts forced to load as Uncategorized
- replicate url permalink after migrating to wordpress
- I need to change the attribute of the isPermaLink guid in the WordPress RSS feed – from false to true
- Permalinks Question: Adding a prefix ONLY in front of the posts
- Modify post slug before saving
- Changing permalink for blog posts, current structure www.website.com/blog-post, change to, www.website.com/blog/blog-post
- Permalink refresh, the good, the bad, etc. What is best?
- Xampp 7.3.3 fresh install of WordPress 404 pages unless permalink is set to plain
- Make the blog page a child of another page and rewrite the blog url
- WordPress slug confusion
- Author URL using wrong domain after using Edit Author Slug
- 404 on wordpress multisite Permalink pretty URLs
- Cannot publish posts or pages when I change permalink structure
- Question About Permalink in wordpress
- How to make “single post” permalink maintain it’s sub-page structure
- Remove Permalink of certain posts
- Create new URL structure for custom post types
- append current user-id to all internal permalinks
- How to find a page in admin based on it’s permalink
- rebuilding/ rewriting a url to make it SEO friendly
- Very strange behaviour related to htaccess and custom posts and custom posts substrings (BUG?)
- Page returns 404 for specific permalink
- issue with the_permalink
- Pagination links for taxonomy archive page 404 error on every page except first
- Changed Permalinks settings, how do I redirect posts on Nginx?
- Facebook Share Permalink Javascript href
- Change all pages permalinks instead of hierarchical to have id of the page
- where is the media permalink info stored in database?
- how to change single post link
- Links after changing hosting and domain
- Change the permalinks structure
- How to create an IIS7 re-write rule for a single category
- Although rewrite engine is on, I get 404 not found on every page
- how to change permalinks from id to name of a particular location
- Find which Permalink structure is the best
- Using a taxonomy value as part of a post URL
- Permalinks of New Pages and their Parents
- Leverage permalinks with AJAX
- Styles are not loading when changing permalink to %postname%?
- Getting the Posts’ permalinks from XLMRPC
- WordPress: Permalinks link to old names
- Creating complex URLs with WordPress permalink structure
- Permalinks is not working in my wordpress setup
- Use .htaccess to redirect homepage to its permalink
- -2 generated in permalink postname [duplicate]
- Change default URL (or permalinks) in the back-end
- How to put link on a slideshow gallery?