I work with wordpress site, where now category page is accessible from two types of links:
http://SITENAME.com/category/CATEGORY-NAME/
http://SITENAME.com/CATEGORY-NAME/
And from right-side menu the links shown as first type, which is wrong.
I need to setup side-menu links to looks like http://SITENAME.com/CATEGORY-NAME/ (without 'category' in every path).
How it can be done? I haven't found such settings neither in admin panel nor in templates...
I would recommend this plugin:
http://wordpress.org/plugins/wp-no-category-base/
The plugin requires no setup or modifying core wordpress files and will not break any links. It will also take care of redirecting your old category links to the new ones.
If you run a multilanguage site with WPML plugin, try this:
http://wordpress.org/plugins/no-category-base-wpml/
Related
I installed Wordpress in "localhost/" directory.
I created a file called home.php and designed it as a landing page.
I want to move my default blog posts to the "localhost/blog/" directory.
But I don't want other links to be affected by this. So "localhost/blog/contact" is wrong behavior.
But every way I tried caused problems like this.
https://wordpress.stackexchange.com/a/238727/183195
https://wordpress.stackexchange.com/a/245136/183195
https://wordpress.stackexchange.com/a/131667/183195
https://stackoverflow.com/a/60605443/12944128
All of these only work as a "single post" way. So "localhost/blog/" does not contain an archive and will not work. Only the "localhost/blog/post-slug/" link works.
Is it that difficult to create a blog with an archive page of its own "slug" in WordPress?
Don't believe you can do it without some serious htaccess manipulations. The permalink structure is set up for either including the 2nd level or not, no in between.
I have a site which is the cms of Eccube ( ecommerce) . It doesnt have dynamic post feature like in wordpress and all.
I want to integrate the wordpress inside my website. It can be anywhere like new page or anywhere.
I have also installed wordpress inside eccube directory with folder name BLOG .
So the actual path is like this :-
/public_html/azlily.awe.jp/eccube_1/html/blog
I have created a new post, thats fine but going to that post will open in wordpress templates, It will look like two different websites. I want the post to appear inside my eccube website but not with wordpress website.
Any solution for this. I googled but only found Wordpress and html website hook up but not with eccube.
Only one option is redirect wordpress blog to "www.example.com/blog" or "blog.example.com" on click
You can access wordpress blog from "BLOG" folder directly
You need to change layout of the wordpress blog so that it will match with your main website, So that it wont appear like two different websites
I did a great amount of research and came across some solutions like this:
https://wordpress.stackexchange.com/questions/106042/force-wordpress-to-show-pages-instead-of-category
But still it isn't exactly what I'm looking for. First of all let me explain the problem.
I made a page /blog/ and a category 'blog' both make use of the permalink /blog/, disabled the /category/ permalink so the SEO will be correct.
The solutions I came across didn't match the following requirements:
Not using 301 redirects
Disable the /category/ use within Wordpress.
Also make it possible to only replace category when a page id uses the same slug.
I simply like to tell Wordpress to display the page instead of the category.
Why don't you just edit the category template?
Because the page I created uses Visual Composer (Post Masonry Grid) so I can't simple move the design.
Why don't you just use redirects?
I would like to but the permalink of the blog is the same as the page (SEO purpose.)
I know it's a few years later with no solution, but I had the exact same problem you described on one site that was working in other sites. So I did some research on what was different and to help others should they run into the same issue.
Background
example.com is the domain
I have a WP page called "foobar" with content
I have a WP post category called "foobar"
I have a WP post entitled "fun things to do with foobars", and the category is set to "foobar"
Expectations
When I go to example.com/foobar, I want to see the page about foobars, not a WP category page that shows all blog posts with that category.
When I go to the blog post about fun things, the URL is example.com/foobar/fun-things-to-do-with-foobars/
Setup
Here's my setup (it does not require any additional plugins or code edits)
A couple of installed plugins are WP Rocket and Yoast on which I'll focus in this thread.
WP Dashboard->Settings->Permalinks
Select "Custom Structure" and enter /%category%/%postname%/ in the field
On the same page, change "Category base" to a single dot. "." (no quotes, just a single dot/period/full stop
I have Yoast installed, which I had set up to override the permalink settings, but I believe this messed up my task at hand.
WP Dashboard->SEO->Advanced->Permalinks(tab)
"Change URLs->Strip the category base..." = Keep
Then you need to clear the cache. I use WP Rocket for caching, so I flushed the cache and everything now works the way it should.
Edit: make sure you save your changes after steps 3 and 5
I know this topic is old but question is still important.
I will use blog example.
This method is code free, WP native solution. One caveat is that you cannot translate "blog" slug, so this method is only for one language if you don't need to have different words/slugs for other languages.
Create page with slug "blog". Or whatever you like. It must match word you put in next step as base: blog = blog it this example.
Set permalink structure in settings to: /blog/%category/%postname%/ (/ trailing slash on the end is your preference)
Use SEO plugin like Yoast or Seopress Pro (or any other
method) to remove /category from URL.
Go to Settings -> Reading -> "Your homepage displays" section -> "A static page (select below)"
Set your static page for Homepage
Here is the magic: set Posts page to your "Blog" page.
Flush permalinks by visiting and saving settings on Permalink page (without any change).
Then you will get proper URL: /blog/yourcategory/single-post-title/
Breadcrumbs will work, all categories will be hierarchical, and /blog will work as page instead of category.
Most importantly, when you go to your category page you will get /blog/yourcategory URL and it will work as archive page. When you visit single post, then also you get URL /blog/yourcategory/single-post-title/
Breadcrumbs from Yoast should work. I use Seopress Pro and breadcrumbs works like a charm (you have to go to breadcrumbs setting page and select categories for posts and posts for categories and tags if you need them).
If you do it without including /blog in your permalink setting it will still work, you will get page instead of category with proper url for categories, but single post will be /yourcategory/single-post-title.
I have a Fishpig/Wordpress installation on my magento site. All works nicely apart from when I look at a child category page. For example if you visit:
http://www.kitronik.co.uk/blog/resources/
then click on a category eg E-Textiles:
http://www.kitronik.co.uk/blog/resources/e-textiles-tutorials-resources/
You see that there are no longer breadcrumbs. I can't see why there wouldn't be any for this page?
From looking at your site I can see that you have something custom going on with your breadcrumbs. On the Resources category, by default, the Magento WordPress Integration extension would insert a 'Blog' breadcrumb between the home page and Resources breadcrumb items.
As for the sub-category, the breadcrumbs are pretty much missing completely (other than the home item).
My recommendation would be to check your page/html/breadcrumbs.phtml. If this file is present in your custom theme, trying renaming it to breadcrumbs.phtml.old. This will allow the original breadcrumbs.phtml file to be used from base/default. If this resolves your problem, you know that custom code in your breadcrumbs.phtml was the problem.
Alternatively, do you have a Magento SEO extension installed that modifies your breadcrumbs? If so, you could try disabling this temporarily and seeing whether this resolves the problem.
I'm trying to figure out how a certain WordPress sets things up. I'd like to have a special page where I could make WP calls and interact with the theme, without affecting anything else.
I just making test.php and putting it into my theme's folder, but that doesn't work.
#Eliran provides one possible option, but you could also add a page in the back-end of WP, just make sure it has the slug 'test', and change your 'test.php' filename to 'page-test.php'. If you're worried about the public seeing this, set the page visibility in the admin to 'private'.
Edit:
to move your understanding along a little further also, you should review the way that WordPress determines what file to grab to render a particular URL. This can be pretty confusing to start with, so be patient if you're not familiar with it, but it's at the heart of designing WP themes. I'll link to the examples, and if you scroll down a little there's a diagram that, along with the text, will help you see how WP is 'thinking'.
http://codex.wordpress.org/Template_Hierarchy#Examples
You can see here: Page Templates
all you need to do is create a page named page-{custom-name}.php and add it to the theme folder.
and inside this php file add:
/*
Template Name: My Custom Page
*/
and than to use this page you need to go to the wp-admin, add/edit a page and chose it:
inside the php file everything you do is classic wordpress.
all this is giving you is a custom page tamplate.
Put it in your root folder. When you go to look at it, you'd look at www.mywebsite.com/test.php
It may be other ways to do this, but I rather use the rewrite API and custom query vars, to create custom routes.
A previous answer on the subject can be found here
The basic idea is to add a new url rule, catch the query var with the parse_request filter and maybe do a die or redirect to prevent the default wordpress template from loading.
I prefer this over theme templates, because with templates you need to create a page for each new url, and if that page gets acidentally deleted, that functionality would stop working.
What Pages are Not:
Pages are not Posts, nor are they excerpted from larger works of fiction. They do not cycle through your blog's main page. WordPress Plugins are available to change the defaults if necessary.
Pages cannot be associated with Categories and cannot be assigned Tags. The organizational structure for Pages comes only from their hierarchical interrelationships, and not from Tags or Categories.
Pages are not files. They are stored in your database just like Posts are.
Although you can put Template Tags and PHP code into a Page Template file, you cannot put these into the Page or Post content without a WordPress Plugin like Exec-PHP which Read overwrites the code filtering process.
Pages are not included in your site's feed.
Pages and Posts may attract attention in different ways from humans or search engines.
Pages (or a specific post) can be set as a static front page if desired with a separate Page set for the latest blog posts, typically named "blog."
More About Pages.
In WordPress to add a new page you have to log in to the admin/backend and from the pages menu you can add a new page. In this case, you can select templaes for your page and also you can create a custom page template for that page.
You may read Createing a new page in WordPress. and custom Page template in WordPress.