I need to have a different background every page, i mean really page, i’ll not use posts.
WordPress does not work well with large numbers of Pages. If you’re not going to use Posts, then I would reconsider your choice of using WordPress and consider other CMS systems instead.
TurbiX,
You’d have to edit your header.php to remove the <body> tag and everything underneath it and put these lines in the appropriate theme files, like page.php, single.php, index.php, archive.php, etc.
Otto42,
WordPress does not work well with large numbers of Pages.
I’m curious why you say this? And what do you consider a ‘large number of pages’?
I’m curious why you say this? And what do you consider a ‘large number of pages’?
Pages create additional rewriting issues and do not scale particularly well in the current code base. The exact number is not a fixed value or anything like that, there’s no hard upper limit, but when you create lots of Pages (hundreds/thousands), then WordPress tends to get really slow. Whereas it can handle multi-thousands of Posts with ease.
It’s simply not designed for lots of Pages, it’s designed for lots of Posts. If you’re not using Posts, then WordPress is simply not the best choice of a CMS. In the end, WordPress is made for blogging, not generic website management.
Thanks Otto,
I’m curious what the exact rewriting issues are.
Not a real issue for me, though. I use WP for a CMS all the time, but usually the sites I’m working on have less than 25 – 50 pages and the rest are more dynamic blog-type content like ‘news’ or ‘articles.’
Still, if lots of pages are a problem for WP, it would be great to see this improved so it can be a more robust CMS competitor.
The major issue has been partially fixed in 2.5, however there are still cases that will not fix the problem.
The main problem is the rewrite_rules option in the wp_options table. In certain cases, every single page generates a new entry (or more than one) in this array of rewrite rules, making both loading and processing very slow. (Note that fixing this problem also resulted in the “issue” where you cannot use a number as the page/post slug.)
More info: http://trac.wordpress.org/ticket/3614
The short of it is that Pages are, in general, kind of a hack. WordPress is primarily intended for Posts. Pages are a special kind of Post… one with special rewrite cases. Those rewrite cases are far slower, but because Pages are generally considered to be a) static and b) few in number, it’s not considered a particular problem.
Thread Starter
turbix
(@turbix)
sewmyheadon
i’v tryed it but the HTML generated as output gives
<body class=”page-“>
instead of something like
<body class=”page-3″>
in the other topic people said that the code needs to be in the loop but i can’t make it working.
Otto42
i’ve only 5 pages. I’m using wordpress couse more people that don’t know html needs to update them frequently and i need some nice plugins like event calendar.
Thanks if someone can help me.
Are you sure you have it in the Loop?
You’ll need to make sure the <body> code comes after the opening of the Loop, which should look like:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
I have the same prob [class=”page-“]
<?php if (is_page()){ ?>
<body class=”page-<?php the_ID(); ?>;”>
<div id=”page-<?php the_ID(); ?>;”>
<?php }else{ ?>
<body>
<div id=”page”>
<?php } ?>
if I place this in the header it doesn’t work (apparently because its outside the loop
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
but it works if I place it in the footer!! wot the hey?