when you say "put fancy permalinks" do you mean you went to "Settings->permalinks" and changed the setting to custom and entered /%postname%/ or did you use a plugin?
also, visiting /news/ would lead you to the PAGE called /news/ . If you want to have it just be localhost/news/ just create a page called news, then use a page template for that page and query for all posts in the category news.
If you have a page called wordpress and a category called wordpress, then yes, you will be making a headache for yourself. Honestly the /category/ in the link really helps me know that im browsing all posts in that category.
My end goal is to have like you said: Page called news and all the posts from news category attached to them. The problem is that this will be a redesign of an old static page that has a url for example: mydomain.com/news and if i put different url ( /category/ in between) it will broke many links from other sites.
One thing that partly solves my problem is to set a static page and to choose a post page: "news". That seems to work
you could try querying for the news category on your news page.
Make a blank news.php page in your theme file and use this code to make it a template
<? /* Template Name: News */
get_header();
then to query for posts in the news category, just use the query_posts function
//The Query query_posts( 'category_name=news' );
//The Loop if ( have_posts() ) : while ( have_posts() ) : the_post(); //put all of your code in here to echo a post, such as: the_title(); endwhile; else:
endif;
//Reset Query wp_reset_query();
//this calls the sidebar, if you dont want that, then delete this next link get_sidebar(); //this next line calls the footer. get_footer(); ?>
So all together your code in news.php looks like this.
<? /* Template Name: News */
get_header();
//The Query query_posts( 'category_name=news' );
//The Loop if ( have_posts() ) : while ( have_posts() ) : the_post(); //put all of your code in here to echo a post, such as: the_title(); endwhile; else:
endif;
//Reset Query wp_reset_query();
//this calls the sidebar, if you dont want that, then delete this next link get_sidebar(); //this next line calls the footer. get_footer(); ?>
then go into your backend to the news page and choose "news" from your template dropdown on the right-hand side.
Thanks dhechler for this. Friend that im setting up this, decided its not a big deal to have a /something/ in between, but ill sure use your sugestion sometime in the future.
I made an a category that i call "news"
I put fancy permalinks /%postname%
I also made a menu and put "news" in it.
But when i navigate to this category "news" the url is like this: localhost/category/news
What i want is to be just: localhost/news
Any sugestion?
Thanks for help
I went to settings-permalinks etc. yes
I'll try what you suggest. I don't know what you mean by use a page template. Will google...
Thanks
http://www.wprecipes.com/how-to-remove-category-from-your-wordpress-url
"
By default, WordPress category permalinks are displayed that way:
http://www.catswhocode.com/blog/category/wordpress
As you can see, the category in the url is pretty useless. Here's how to remove it:
First backup your .htaccess file. Then, open it and append the following line:
RewriteRule ^category/(.+)$ http://www.yourblog.com/$1 [R=301,L]
Once saved, your categories pages will be displayed like this:
http://www.catswhocode.com/blog/wordpress
"
WIll i be making more trouble in future with this, or is it safe?
The problem is that this will be a redesign of an old static page that has a url for example: mydomain.com/news and if i put different url
( /category/ in between) it will broke many links from other sites.
One thing that partly solves my problem is to set a static page and to choose a post page: "news". That seems to work
Make a blank news.php page in your theme file and use this code to make it a template
then to query for posts in the news category, just use the query_posts function
So all together your code in news.php looks like this.
then go into your backend to the news page and choose "news" from your template dropdown on the right-hand side.
Hope this helps you get where you need to go.