kobashicomputing
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Page.php and The Loop“The code you posted above is incorrect.”
How so? So your rationale is just because I don’t do the same as Twenty Eleven and Ten that you assume that I am doing things wrong? Then why do three themes I wrote work perfectly fine not using a single while loop in page.php?
Twenty Eleven and Ten use page.php to build pages of blog posts that are interlinked. This is the WORST way to build an informational structure.
Do you want URLs that look like this?
mysite.com/page/1
mysite.com/page/2
.
.
mysite.com/page/10230What happens when I write a “My Dog Ate My Paper” blog entry and it appears on page 1. All blog entries are shifted down one slot. The one’s at the end of the page fall off and start on a new page.
People nor search engines care what page number a blog post exists on nor will they remember it. Nothing on those pages are ever a unique footprint. Creating page URLs this way can create duplicate content penalties, be interpreted as cloaked pages, etc.
I don’t know about you, but I would not go about creating themes this way.
Forum: Fixing WordPress
In reply to: Posts under a PageI dont think this has anything to do with themes and templates. Better to ask this in How To’s and Troubleshooting.
Forum: Themes and Templates
In reply to: Page.php and The LoopHe isn’t talking about archive.php or index.php here. He is talking about page.php.
I don’t call the loop explicitly in any of my page.php templates.
page.php in all my themes don’t have a while loop in it. I’m just rendering a single instance of a page – not a series of one or more posts.page.php
————<?php the_post(); ?> <article> <header> <?php echo "<h1>" . get_the_title() . "</h1>"; ?> </header> <?php the_content();?> </article>
See any loop?
Forum: Themes and Templates
In reply to: Editing customizable themes without activating them“Use the customization options”
Each theme serializes and unserializes its options in its own way. Some will pack the options in multi-dimensional arrays others will store as single variable entities.
The state of a theme’s options are stored in the wp_options database. You need to activate the theme and press the Save button to get the data persisted. Start with a clean wordpress install and export the wp_options table to take a snapshot. Then, install the theme you want to look at. Export the wp_options table again and do a comparison.
If the theme does not clean up the options table after being deactivated, you could (if you knew what each option was) conceivably reuse those options stored in the database. However, it would be wise to make a copy and prefix the option with your theme name.
Just bring up phpmyadmin, show 1000 records and then sort on option_name. Usually good themes will store their options with a prefix of their theme name. To see how it serializes and unserializes the data, search throughout the theme code for get_theme_option and update_theme_option to get a better idea of how they store.
Also by “reusing” you need to mimick the forms and the loading, resetting and saving.
Forum: Themes and Templates
In reply to: Page.php and The Looppage.php is not meant to be looped. It has a context built in and global variables are set to the current page. page.php is for pages (posts and pages are two different things) that appear at the top of your navigation menu like about, home, contact, etc.
Also if you created a navigational menu, you have to make sure that your links relate to the permalink structure you created (that is if they are on). The correct url is just below the title in the edit page screen.
If your theme has navigational menus enabled, you should see a Menus option below the Appearance section. When you associate pages with a menu, check to make sure the URL correlates with the permalink.
Forum: Plugins
In reply to: [WP Realtime Sitemap] [Plugin: WP Realtime Sitemap] Shortcode isn't workingTo get 1.5.4 to work, I had to do the following:
1) Use the shortcode [wp-realtime-sitemap] and get rid of the show=all parameter
2) Change the order settings to be all different. By default, they were all set to Menu. With that setting, the sitemap didn’t create anything (I would have expected 7 menu sitemaps, not empty sitemap).
So after setting all orders to be different and not have any matches, the sitemap appeared.
However, I did a test afterwards. Strangely, when I set all order settings to Menu, it worked and I got 7 menu sitemaps (which contradicts the default scenario above).
I’m thinking the plugin should set by default all seven orders to be different settings to avoid confusion and retain sitemap functionality?
Forum: Fixing WordPress
In reply to: Fatal error: Cannot redeclare class wpdb in…. db.php line 54You never told us that you were using DB Cache. This had nothing to do with W3 Total Cache.
Now one look at DB Cache’s compatability section should have told you not to install this plugin (0.6) because it is only good up to WordPress version 1.27. Also, the installation instructions to DBCache spoke of db.php which would have clued you in.
To look more into the problem, I tested this on a clean install with current version of WordPress 3.2.1 and DB Cache 0.6. What I found was this:
A) After enabling the cache, db.php shows up in the wp-content folder. db-module.php (part of DB Cache) gets copied as db.php. db-module is an copy of the core file wp-db.php. All are of the same version (0.71).
B) After ticking the enable cache checkbox, I proceeded to get errors everywhere I attempted to navigate within the WordPress dashboard. Namely, this error prevented use of admin and at this point was hosed:
“Fatal error: Cannot redeclare class wpdb in C:\wamp\www\iwordpress.com\wp-content\db.php on line 54”
Developers:
This problem is being caused due to a conflict in the naming of the database driver class. In require_wp_db(), wp-db.php is loaded and if db.php exists, db.php is loaded as well. But because both files declare a wpdb class, this error occurs. Developer needs to create a different class name and rewrite code to fix this bug.
Forum: Fixing WordPress
In reply to: Add coupon to header–helpIf the coupon is to appear in ALL pages, then you would go to the theme and edit its header.php file.
Assuming you have a coupon that is 80 pixels in height:
<div style="float: left; clear:both; text-align: center; width: 100%; height: 80px"> <img src="/path-to-your-coupon-image-here.jpg" alt="Our store coupon"/> </div>
You would place this somewhere near the top of your theme’s body tag, but this depends on the theme itself. I would suggest placing it at the very top of your page so that users will see it.
Forum: Fixing WordPress
In reply to: Fatal error: Cannot redeclare class wpdb in…. db.php line 54What plugin? The cache plugin that is causing your problem of course.
Whenever you run into a problem of installing a new plug in, the solution is to deactivate it, delete it. Then check to see if your website works.If it does, then you pinpointed the problem to be the plug in. This avoids sendingg everyone on a wild goose chase. Also, give us some more information. Leaving out the version of WordPress and the name of plug in doesnt help us.
db.php is W3 caches database module. I just downloaded the current version of W3 cache and there is no line 54 of code that correlates to your problem. This tells me that db.php is being included programatically twice.
It is best at this point that you reinstall. Why I say this is because W3 is running on WordPress websites around the world and it is running just fine (including several of mine).
Do this:
1) Deactivate the W3 cache plugin.
2) Delete W3 cache plugin
3) Visit your website. Does the problem happen? If not, its the plug in.
4) Upgrade to the newest version of WordPress
5) Install the newest version of W3 cache plug in and activate itIf it doesnt work at this point, I dont know what to tell you.
Forum: Fixing WordPress
In reply to: Limit Number of Images in UploadJust switched to Suffusion theme.
This thing creates
24×24
36×36
48×48
64×64
96×96
150×150
300×169
1024×577About 350K of total file size from an original 180K PNG file.
This theme too, doesn’t show any of its file size settings on the media settings panel.
Users should be able to control and select the image file sizes. The image descriptions (i.e. large-image) should have a description next to it to tell the admin what types of images belong to that category along whether it is optional or necessary. That way we can reduce the amount of disk space being used and reduce the amount of files to search through the media manager (which is useless because of horrible categorization facilities).
Forum: Fixing WordPress
In reply to: Limit Number of Images in UploadThe default twentyeleven theme registers additional image sizes for custom headers. Effectively for header image:
set_post_thumbnail_size(1000, 288);Custom image sizes effectively
add_imagesize(‘large-feature’, 1000, 288);
add_imagesize(‘small-feature’, 500, 300);I’m assuming here that because the images that I am submitting are over the width and height of the custom header image, that the behavior of the uploader is to take any images over that size and apply all the image sizes registered, thus causing additional files.
The problem here is that the large-feature and small-feature properties are not being shown in the media settings. If it were, I could disable the rendering of those images by ticking off or setting to 0 the width and heights to avoid generating the files.
Switching to another theme.
Forum: Fixing WordPress
In reply to: Nested ULsGo into the visual editor. Select say the bullet list. Type your first list item in.
Then, to start a new nested list, hit return and then click on the right indent button. Then a new list will appear. To continue with the first list, click on the left indent.
Forum: Fixing WordPress
In reply to: Fatal error: Cannot redeclare class wpdb in…. db.php line 54Deactivate the plugin and remove it. It is likely incompatible with your version of WordPress.
Try W3 Total Cache. Its widely used and the most popular caching plugin out there. Make sure you got the current version of WP running.
Forum: Fixing WordPress
In reply to: Warnings after update to 3.1.3I am getting a ton of warning messages on 3.1.3 in the media area as well. Turning off PHP display_errors doesn’t work. This is happening on Windows XP and Windows 7. This doesn’t happen on a Linux box.