Assign a parent page to all WordPress posts - wordpress

I am building the actual Website as well as the blog into a single WordPress theme. I've got everything setup, there is a blog page (www.mysite.com/blog/) which is set as the "Posts Page" and all the posts are displayed on this page as excerpts.
However, each post has the following URL: www.mysite.com/post1/, I need all post to have the blog page as their parent, so that their URLs will change to: www.mysite.com/blog/post1/.
How can this be done?
Thanks in advance
Willem

You can do this easily by changing your permalink structure. Just include /blog/ at the start of your custom structure.
It seems to only affect posts and not pages, which is what you want.

Related

For each WordPress page of my site why I have two URLs?

In my website, I set the custom structure permalink to "/post/%postname%". I want the URL of a single blog post like domain/post/postname and it is working fine but in addition to this every page of the website following both domain/post/pagename and domain/pagename URLs but for pages, I only want domain/pagename.
Both of these URLs landing on the same page
https://shergroup.com/aboutus
https://shergroup.com/post/aboutus
I only want https://shergroup.com/aboutus for pages.
Change permalinks from setting to http://localhost/yoursitename/sample-post/
On pages, the simple posts will be changed to the page names.
And in your website, if you want to show a blog page like https://shergroup.com/aboutus/blog/ for that you need to change the slug of the web from /blogs/ to aboutus/blogs in a page but in my opinion, it's fine.
Change Permalink common and optional settings (both), then you will get desired url structure.
Path : Setting > Permalink

WordPress Blog Slug Issue

Recently I have made a website and since then I am trying to post my new posts on my blog page but it's not showing there.
I have updated settings also where I have made my blog page as a post page.
Whenever I am trying to go to my blog page from my website it is showing index/blog/
And parent directory underneath that.
If anyone can help me in this I would be more than happy.
Check if the Permalink is set to Post Name. If not try to set Post Name as Permalink from Settings > Permalink. (https://i.imgur.com/jJZ9wJo.png)

Add Posts page slug to Single Post permalink structure

Does anyone know if it's possible to place WordPress Blog POSTS in a unique directory?
In other words:
mywebsite.com/blog/Post-A/
mywebsite.com/blog/Post-B/
mywebsite.com/blog/Post-C/
I'd like to create /blog/ which I believe is done by creating a PAGE but that doesn't seem possible.
I've googled this for the last few hours and still can't figure it out.
The only way you're probably going to be able to do this without a plugin is by utilizing Categories and a custom permalinks structure.
Navigate to Posts > Categories
Add a new Category
Apply the Category to the desired posts
Navigate to Settings > Permalinks
Select Custom Structure and apply the following structure: /%category%/%postname%/
There are also plugins that expand endpoints and routing. https://wordpress.org/plugins/custom-permalinks/
If your goal is to not have the posts on the front page, you can also set the Blog page to a specific page in Wordpress.
Create two new Pages (not to be confused with a post)
Navigate to Settings > Reading
Set Front page displays to A Static Page
Select the Pages to be displayed for the Front page and the Posts page
The Blogroll (Posts page) will then appear under the endpoint of the defined Page's slug. However, the individual posts permalink will not have the Blogroll Page's slug in the route.

.htaccess issue in Wordpress giving 404 on all pages

I have a wordpress multi-site:
site1.local.loc [with subdomains on my local] and I would like to have three pages on this.
site1.local.loc/works - (posts page, but I want 'Works' as my title)
site1.local.loc/about - (static page)
site1.local.loc/contact - (static page)
Since 'Works' is my posts page where I keep putting in content, I changed my permalinks for this site to:
/works/%postname%/
However, when clicking on 'view post' at the end of posting anything, it leads me to a '404' page which means there is a disconnect. This is also the case for viewing any page. Is my .htaccess file faulty?
How do I solve this? Also how do I make all my posts appear in my 'Works' page (as in, how to make that page the posts page?)
Thanks!
Updated: I've found out that I get a 404 for any page that I create for a site in a wordpress network.
You do not have to touch .htaccess file.
Make a custom post type that is called works. All those posts made in that custom post type will have that url that you desire. There is no other way to do it. (even if there is, it must be dirty) That is celanest way, and since wp does it by itself you can expect that nothing will go wrong wnen you update, install plugins, etc.
Create a category called "Works" that would then show all posts added to that category by simply going to /works/ all posts would then be shown as /works/post-name/.
You will need to change the permalink structure to /%category%/%postname%/
Check this in administration
Settings > Permalinks > Post name

Why does my blog page only show one post?

I didn't think I would encounter this kind of problem in creating a static front page because this seems to be a very trivial customization of wordpress. I am using Thematic as my parent theme. I created a home.php template and pasted the code from the parent's page template into it. I also created two new blank pages named Home and Blog. I set home.php as the template for page Home. Then I went to Settings->Reading and set my front page to a static page and selected page Home. I also set posts page to page Blog. Now when go to my Blog page, I only see a single post?
What is set for "Blog pages show at most" in Settings>>Reading? Do you have more than one post?

Resources