I'm trying to achieve a multiples posts pages so I can style them differently based on their content
for example:
articles posts page - /essay-&-articles
books posts page - /books
foods posts page - /foods
article single post page - /essay-&-articles/1
book single post page - /books/1
food single post page - /foods/1
It seems that you're looking for permalinks and slugs. You can use the category and post_id for the URL, as long as your posts already have the category(ies) assigned.
In your WordPress Dashboard, go to Settings, then Permalinks. There are some existing permalinks you can use, but based on what you want, the entry will look like this:
/%category%/%post_id%/
Each post has a unique ID, and can be accessed using the same ID on any category(ies) it has assigned. You can read the WordPress documentation about permalinks for other customization ideas, too.
Related
I have several categories in my WordPress blog. All posts are available through domain.tld/post-title. But now I need different urls for certain topics.
Example:
Blog > domain.tld/post-title
Category 1 > domain.tld/category-1/post-title
Category 2 > domain.tld/category-2/post-title
Category 3 > domain.tld/post-title
I would prefer not to use a plugin and set everything via custom-template.php or functions.php. I have seen a few solutions with str_replace, but unfortunately none of them worked properly for me.
I also use different layouts for different categories. So I could also use something inside the template file to change the urls.
This should be available through Wordpress' default functionality by using categories for each post & updating the permalinks.
If you already have the categories in place under "Posts -> Categories"
and have assigned them to each post then your next step would be setting how it is displayed in your Permalinks tab.
Here you can set site-wide URL structure. In your case it would use
/%category%/%postname%/
which would put the category before the title of the post each time the URL is spun up by Wordpress.
I have seen many blogs and tried but I want something another.
The blog post URL I've tried -
localhost/post/how-to-include-category-title-in-blog
same for
localhost/post/how-to-create-php-script
There is the common thing is post page -----
I need that -
Suppose that I have three categories in my blog - PHP, HTML, CSS
I create posts in every category -
So the URL should be -
localhost/php/what-is-php
for CSS posts -
localhost/css/what-is-css
for HTML posts
localhost/html/what-is-html
Syntax like -
localhost/category_name/post_title
The category should be related to the post.
I need to remove the post and want it dynamic.
localhost/post/how-to-create-php-script
the post is a page in the blog. I want it to remove and manage according to these URL -
localhost/php/what-is-php
localhost/css/what-is-css
localhost/html/what-is-html
I am working on PHP core.
You want to get familiar with the Parmalinks page in WP admin. Here is the documentation from WP: https://wordpress.org/support/article/settings-permalinks-screen/
For your need you probably want to try a custom permalink config like:
/%category%/%postname%/
I have a website, here is the link for reference and visualization, made with wordpress twentyfourteen theme. Currently, in the main page, the main area have blog posting from all categories (currently news and featured). How can I limit it to list only "news" category ? the reason is I dont want to mix it with featured, so that featured is only listed on the right sidebar.
Here is a screenshot for better understanding:
There is no option to do this, but you can go to Page (or Post) settings and choose if you want to show this page/post manually.
Checkboxes inside page/post settings (check or uncheck):
Featured posts
Newest posts
Also, I recommend to watch tutorial how to hide it in this way:
Source
I have a WordPress for my science journalism blog and I would like to add a page that contains a subset of the blog posts. For example, having a page populated by a certain category (i.e. review articles) or tags (i.e. physics).
There seems to be a way to do this by making a new php page, but I am not sure how to get to a blank template to add the code base.
Alternatively, I would prefer having a way to do this without having to mess with the code at all. Any help would be much appreciated. Thanks!
This happens automatically with WordPress; read the docs:
When a viewer clicks on a link to one of the Categories on your site,
he or she is taken to a page listing the Posts in that particular
Category in chronological order, from newest Posts at the top to
oldest at the bottom.
Read https://codex.wordpress.org/Category_Templates
You don't have to make a category or tag template page, but you can if you want to. This is theme-dependent; your theme may already have different archive page templates.
The URL for a category or tag archive page will be:
example.net/category_base/category_name
example.net/tag_base/tag_name
Read https://codex.wordpress.org/Using_Permalinks#Category_base_and_Tag_base
Go to Appearance>Settings>Reading to set number of posts per page and either excerpt or full post.
I think you should be able to get at a category by going to http://example.com/category/mycategory
And to tags by visiting http://example.com/tag/mytag
You should be able to add categories to the main menu, and add tag pages via a custom link OR use a tag cloud?
Hope this helps.
I recently added a functionality to allow Twitter to create blog posts automatically whenever a new tweet is posted. As I'm using Wordpress Jetpack Publicize so I wanted the title of the posts to be the full tweet, that way it'll automatically update all my social channels.
As the permalink setting I'm using %postname% for all posts but in case of Twitter posts it gets way too long and creates issues with Backup and other things.
The Twitter post is assigned to a category Tweets so I want wordpress to set custom permalink for the same category posts. How can I do that?
You can see the twitter posts at my blog - http://robo.im/blog
I'm using Wordpress Plugin Twitter Tools to fetch the new Tweets
Just set the custom premalinks to /%category%/ here you can read what to do if posts have multiple categories.
But if not change urls for all categories, use custom post type instead of category, and follow one of many tutotrials how to change permalinks for that type.