Reputation: 1136
I'm trying to create my own theme, called "Conservatoire". For that I've first added the style.css with these informations :
/*
Theme Name: Conservatoire
Theme URI: http://wordpress.org/
Description: Conservatoire
Author: Thoma Biguères
Version: 1.0
Tags: black, blue, white, two-columns, fixed-width, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style, custom-menu (optional)
License:
License URI:
General comments (optional).
*/
So nothing too tricky here i think. After that I added two files. An index.php :
<?php
/**
* The main template file.
*
* @package WordPress
* @subpackage Conservatoire
*/
get_header(); ?>
<!-- Add your site or application content here -->
<!-- JavaScript at the bottom for fast page loading: http://developer.yahoo.com/performance/rules.html#js_bottom -->
<!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.7.2.min.js"><\/script>')</script>
<!-- scripts concatenated and minified via build script -->
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
<!-- end scripts -->
<!-- Asynchronous Google Analytics snippet. Change UA-XXXXX-X to be your site's ID.
mathiasbynens.be/notes/async-analytics-snippet -->
<script>
var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>
Until here everything works. After that, I added a front-page.php which is my static home page :
<?php
/**
* The template for displaying Front page.
*
* @package WordPress
* @subpackage Conservatoire
*/
get_header(); ?>
<?php
$page = get_page_by_title('Accueil');
?>
Everything is still fine. And now things are tricky. I'm trying to add a category-{slug}.php page. So I've created a page category-membre.php which looks fine for me :
<?php
/**
* T he template for displaying Front page.
*
* @package WordPress
* @subpackage Conservatoire
*/
get_header(); ?>
<ul>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<li class="cadre">
<div class="imageCadre">
<?php echo(get_image());?>
</div>
<h4><?php echo(get_the_title());?></h4>
<p><?php echo(get('information_globales_petite_description'));?></p>
<a href="" class="plusinfo">Lire la suite</a>
</li>
<?php endwhile; ?>
<!-- post navigation -->
<?php else: ?>
<!-- no posts found -->
<?php endif; ?>
</ul>
</body>
</html>
?>
But when I try to go on the page "localhost/Site/category/membre then I find myself on the 404 page ...
Does someone has any idea ?
Thanks
EDIT : I didn't changed the permanent link so category base is empty (i guess it's category then isn't it ? )
Here this one was my httaccess but I deleted it and it still gives me the same error :
NEW EDIT : this is the actual .htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /Sites/Association%20CNMP/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /Sites/Association%20CNMP/index.php [L]
</IfModule>
# END WordPress
Upvotes: 0
Views: 3026
Reputation: 1136
Hey thanks for everything,
I managed to make permalinks work. I don't really know how thoug.I know I had to set mod_rewrite of the httdconfig of apache to Ok (erase the # before the Launch mod_rewrite). And after that do some stuff. There is one thing i don't understand though !
How come my actual htaccess looks like this :
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /Sites/AssociationCNMP/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /Sites/AssociationCNMP/index.php [L]
</IfModule>
# END WordPress
but is actually working with cat/membre ? I don't see the cat in the htaccess file. So how can he know he has to go to another one ?
Thanks for your help
Upvotes: 1