Put categories on PAGE url wordpress - wordpress

Ok, here is the thing I have already added the categories to the pages (with the help of a plug-in, it's called Add category to pages) and so now I want to change the URL to display the categories (that is to say I want my pages to have this estructure: mysite.com/%categories%/%page_name% right now it has his structure: mysite.com/%page_name%), I have tried to google it but I can't find a straight answer. So if anyone has some resources (tutorials, articles) or some idea (if it's not to much to ask with code examples) on how to achieve this it would be fantastic. (And believe me, I'm asking as my last resource)

you can do it easily with "Page Parent" option available in WordPress.
Steps To create a subpage
Go to Administration > Pages > Add New screen.
In the right menu, click the “Page Parent/No Parent” drop-down/page attribute widget. The drop-down menu contains a list of all the Pages already created for your website.
Select the appropriate parent page from the drop-down menu to make the current Page a child Page.
Add content to the subpage.
Click Publish when ready.
Output - https://example.com/asia/india/
More Info. - Wordpress Subpage Permalink

well you can do this for categories and products from permalink setting, but if you want to manipulate the page url according to yourself then you need to create an blank page with the prescribed name whichever you want to insert, i.e, if you want to insert amazon within the url then create an url with name of amazon, and put the other url's under this parent page.
This way your url will look like
http://example.com/amazon/page_name

Unable to post as comment so directly posting it in an answer, in WordPress you can have custom URL. After you logged I'm as admin under dashboard you have general settings where you can put custom URL's like http://example.com/%caregory%/page_name
For more reference also checkhttp://codex.wordpress.org/Changing_The_Site_URL
I don't know if you tried this but after you login as admin, under Dashboard>>Settings>>Permalinks>>Custom Structure.
Let me know if you have already tried that.

Related

Wordpress how to link a page to blog content

This may seem novice, but I assure its not.
So, I have a site, which displays blog posts by date from new backwards.
Standard stuff. However, what I'm trying to do is create a temporary homepage, lets call it 'yogo'. It displays some ad, or image, with a button link.
What I'd like is a direct link to the actual blog feed which displays in a given theme site's frontpage. Is it just a block?
When Im in Appearance->Reading, I can change homepage to 'yogo' fine. But, say a visitor is on 'yogo', and I want a button they click on to link to what would be the original theme frontpage with blog content, it should technically be 'Home' but is that coded somewhere through the wordpress software like the Reading mentioned above.
Maybe Im missing something, should I shut off permalinks, and dig for it in actual page extension?
Im trying to avoid using Guten. or Elem. to build out a blog page.
Any advice, thanks in advance.
Once add your code in front-page.php or home.php you can use get_the_permalink() function to get the blog page URL and will pass in "a" HTML tag like this -
Your Blog Name
Might be it can help you.
Just a quick update. actually solved this.. In simple terms, it is possible to do this really quickly through the Wpress UI. From your backend, these are the steps in the following order:
(firstly. shout out 2 user 'mirchev' because if u didn't point out templates I would of been way off. actually after about an hour of research after that) So it all takes place in Setting->Reading. From what I've read, Wpress started off as a blog based system anyways, so it was solved a long time back. Basically to start, 1. Create 2 pages, no need to add any content as long as they are 'new' and you make note of the names.
2. Also important -in the template area to the right panel when the new page editor loads up (you don't need to add any texts, images or whatever, including the area on the right just make sure "default template" is selected. 3. Afterwards, these 2 pages are 2 be used in the Setting->reading section.
What you want to do is when you enter this setting of your Wpress site, instead of having your "homepage" radio button be "latest posts" set it to 'static page,' and 4. important - select 1 of the 2 new pages you created as the static page. 5. Now, also important, for the posts page, select the 2nd of the 2 new pages you created. 6. Once this is done, what happens is your website loads the static page, which you may customize however, and then you can go into your Appearance->menus and add the appropriate link to the 2nd of the 2 new pages you created to load the blog, or link to it whichever way you choose. More often than not a menu item should appear if that is the setting you customized.
..And that is all. if fact I was very surprised just how smooth it was.
good luck ! ..--'''~~**
Separation!

How do I find the parent URL on a webpage (Wordpress)

I am working on a website for a company right now and I am running into this issue:
The original URL is similar to this: mysite.com/industrial/ where industrial has 4 subcategories which each have 2-6 pages within them. I changed the original URL to mysite.com/products/ but the subcategories and pages within are not changing to include products in their URL - they still use industrial.
For ex.: mysite.com/industrial/abc/ should be mysite.com/products/abc/ but it stays as mysite.com/industrial/abc/ after I made my change.
I assume that the subcategories are in a folder called industrial (I did not create this website so I do not know), however I can't find that folder anywhere and I'm not sure where to look. I have tried to go in to each of the subcategories and change their URLs, but I can only edit the abc part of the URL and I can't touch the rest.
** This was all done on Wordpress with a custom theme created by another company. Thank you in advance for any help you can offer!
EDIT: For anyone who is also struggling this problem this is how I solved it:
Go to Plugins -> Plugin Editor
At the top there was an option called "Select plugin to edit" -> chose the one that is custom to your website
I found the information that was suggested by Phil in the comment section on this website
I updated the names of my fields in the rewrite permastruct section for register_post_type as well as register_taxonomy
Update the page and flush your permalinks and you should be good to go!
Check what is the defined slug when registering the custom post type.
Whenever a new Custom Post is added through a plugin or them, then the permalinks needs to be flushed.
In the WordPress admin area, go to “Settings > Permalinks”. Click “Save Changes”. The permalinks and rewrite rules are now flushed.

Add php variable into Wordpress custom menu

I've been trying to figure out how to add a php variable into my WP navigation links.
Let me explain:
I'm gonna set a cookie on the very first page of my website, when the user clicks on one of 4 types of profile:
-family
-pro
-seniors
-cadres
Currently, I have a theme switcher extension wich modifies the WP theme depending on those prefixes:
http://mywebsite.com/family
http://mywebsite.com/pro
http://mywebsite.com/seniors
http://mywebsite.com/cadres
... etc
The colors & content of the 4 "home" pages are different, but I'm using the WP navigation menu (wich remains the same on every page, so the prefixes disappear when clicking on its links).
Initially, I wanted to modify my menu links like that:
https://mywebsite.com<?php if (isset($_COOKIE['profil'])){echo '/'.$_COOKIE['profil'];} else{} ?>/navigation-link1
Here:
menu
But I can't add php here, and the solution is not ideal because it would only apply to the menu, and not the posts permalinks (I want some posts to be available regardless the profile and I don't want to duplicate all my posts).
Ideally, I would like to have a solution to set the WP theme directly based on the stored cookie. This way, it would also apply when the users click on a post permalink.
I've read things about a "walker" but I don't know what it is, wp_nav_menu_objects, but I didn't understand what files to modify nor wich code to use.
I always search the web to find my answers, but I'm french and I think my understanding has reach it's limits, so if somebody could take the time to explain to me like I'm 4 years old :), I would be grateful.
Thanks

Wordpress: show category-page as frontpage

I want to show a category-page on the frontpage without the url changing (eg. redirect).
The frontpage should implement the categories' head and meta tags then and also the top menu should display the appropriate category selected. also there should be a canonical tag to the categorypage so no duplicate content will be generated.
short: the frontpage should exactly behave like a categorypage.
is there a solution?
You can create your own page template and set is as start page.
Go to:
Apperance->Customize
Then Static front page.
Choose "Static Page"
Then choose your page from the dropdown list.
If you need help look at this.
http://codex.wordpress.org/Creating_a_Static_Front_Page
In addition to Tan's answer, you'll need to go to Settings -> Reading and then select 'A static page' for the 'Front page displays' option. After that you can select your previously created page template from the 'A static page' drop-down menu.
When you finish the above, you'll have to edit the source code for the chosen file in order to include a standard wp loop. For more info, please check this thread:
How do I make a Wordpress Page act like the default home page displaying multiple posts?
To control which posts will be shown in the loop use the query_posts(). You can find more details here:
http://codex.wordpress.org/Function_Reference/query_posts

Creating Links inside of Wordpress properly?

I'm trying to create wordpress links using direct links inside of the same wordpress site, say for example...
I would have a <a href="/catagory" >Catagory</a>
I noticed that sometimes, the links might stack on top of eachother on the urlbar when I click on the links from a different page?
say for example it would click on another link then it would turn out to be something like
"www.myWordpressSite.com/catagory/catagory"
Whats the proper way of doing this? Would it be something like
The first /category is what's called a "category base". You can edit it in Settings, Permalinks page.
The second /category is your cateogry
There are plugin to completely get rid of the category base, search WordPress plugins for "no category base" (that's how the plugin is called, nice, huh?)
EDIT:
Um... now I'm not sure I understand the question now after an edit, but if URLs "stack" then you should make sure that they wither start with a / or with a http:// (or https://)

Resources