deko
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: How to disable revisions?Thanks. I’ve also discovered a Plugin called Revision Control here:
http://wordpress.org/extend/plugins/revision-control/
I’d rather avoid adding code to the wp-config.php file.
I just upgraded a few blogs from 2.1 and can’t believe that WordPress has failed to provide a built-in OFF button for Revisions since 2.6! I’m really wondering what went wrong here. If this ‘feature’ got through a review process, what’s next? Is there no longer any adult supervision at WordPress?
I have blogs that contain long posts well over 100,000 characters. And they often undergo small changes. So each time a comma is added or a word is capitalized… zap, another one is added to the database.
So now I have to find a Plugin, install the Plugin, configure the Plugin, then go into the database and issue
DELETE FROM posts WHERE post_status = 'inherit';to get rid of all the unwanted entries. This is NOT supposed to happen with a “state-of-the-art publishing platform.”
Very disappointed.
Forum: Fixing WordPress
In reply to: How to generate 301 error for moved page?I’ll just wait for the search engines to catch up and stick with the “Not found” message. the 404.php file is useless. delete it.
Forum: Fixing WordPress
In reply to: Spam user registrations – my solutionDiscovered Clickcha yesterday… seems to be working well so far. Would be nice if there was a developer forum or programmers reference… has a lot of potential as a comment spam prevention tool.
The problem I had was that it broke my CSS and caused the page to fail validation. Here’s how I fixed that:
1) Go to your wp-content/plugins directory and edit clickcha.php (about line 155) Remove all style directives–that is, everything between (and including) the
<style>tags. Paste it in notepad for now–you’ll want it later.2) remove the
<noscript>and<small>tags (and anything in between) that appear around the javascript code within theclickcha_comment_formfunction. Below is how myclickcha_comment_formfunction looks after editing.Note the /* <![CDATA[ */ … /* ]]> */ addition. This tells HTML validator to ignore the script.
function clickcha_comment_form($post_id) { $public_key = get_option('clickcha-public-key'); $help_text = get_option('clickcha-help-text'); if(empty($public_key)) { echo "<div id='message' class='error fade'><p>Clickcha is not yet active. Please enter Clickcha API keys in settings.</p></div>"; } // Bypass clickcha for logged-in user (except 'subscriber') else if(!current_user_can('level_1')){ ?> <input type="hidden" name="clickcha_token" id="clickchatoken" value=""></input> <?php echo $help_text; ?> <input type="image" name="clickcha" id="clickcha" alt="" src=""></input> <script type="text/javascript"> /* <![CDATA[ */ function clickcha_token(token) { document.getElementById('clickchatoken').value = token; document.getElementById('clickcha').src = 'http://api.clickcha.com/challenge?key=<?php echo $public_key; ?>&token=' + token; } function clickcha_get_token() { var e = document.createElement('script'); e.src = 'http://api.clickcha.com/token?output=json&key=<?php echo $public_key; ?>&rnd=' + Math.random(); e.type= 'text/javascript'; document.getElementsByTagName('head')[0].appendChild(e); } clickcha_get_token(); // Firefox's bfcache workaround window.onpageshow = function(e) {if(e.persisted) clickcha_get_token();}; /* ]]> */ </script> <?php } }3) Edit your stylesheet and put in what you took out of clickcha.php:
here’s how it looks in my stylesheet:
#clickcha input { height: 100px; width: 200px; border: 0; margin: 0; padding: 0; display: block; } #submit { display: none; } #commentform input [type="submit"] { display: none; } #commentform button [type="submit"] { display: none; } #commentform span.submit { display: none; }Now my CSS looks like it should, and the page validates as XHTML 1.0 Transitional.
Forum: Fixing WordPress
In reply to: How to generate 301 error for moved page?I’ve noticed this behavior isn’t unique to my blog.
To duplicate, go to any wp blog and add
?page_id=23423432434to the end of the url, like this:http://www.exampleWPblog.com/?page_id=23423432434If you try this on blogs listed in the Your WordPress forum, for example, you will get a blank page. That’s what I was getting before I added the
<h2>Not found</h2>bit shown in my previous post.Forum: Fixing WordPress
In reply to: How to generate 301 error for moved page?I tried this…
$pid = trim($_GET['page_id']); if ($pid = 362) { header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.example.com/MovedPage.php"); }but received error: “Can’t rewrite headers… already set”
Forum: Fixing WordPress
In reply to: Search results displayed in different page?I settled for a basic form/button instead of a stylized one, so it was simply a matter of putting this code in the header:
<div id="search"><label for="s"><?php _e(''); ?></label><form id="searchform" method="get" action="<?php bloginfo('home'); ?>"><input type="text" name="s" id="s" size="25" /> <input type="submit" value="<?php esc_attr_e('Search My Blog'); ?>" /></form></div>I used the search.php file from the default theme.
Too easy.
Forum: Fixing WordPress
In reply to: Search results displayed in different page?thanks for the tip. I’ll dive in and reply back with notes. I’ve customized my blog so I’m sure some coding will be necessary.
http://codex.wordpress.org/Include_Tagsget_search_formThis tag includes the file searchform.php from your current theme’s directory. If that file is not found, it will generate the search form.
Forum: Fixing WordPress
In reply to: Custom Page Templates?It sounds like
is_page_template()should do it.I’m still a little mystified over how Default and Custom Templates work, however.
I’ve renamed the page.php file in my theme directory to custom_page.php and added the appropriate php comments at the top of the file (I called it ‘Custom Template’). Now I can see ‘Custom Template’ in the drop-down menu when I Add New Page–but I also see ‘Default Template’. Where did this ‘Default Template’ come from?
It looks like this ‘Default Template’ simply uses
index.php, which insertsthe_contentof the Page as well as thecomments_template,sidebarandfooter. I assume I can useis_page_template()to customize (or omit) each of these components as needed.Since I want all my Pages customized the same way, couldn’t I just use
is_page_template('Default Template')in each component file of my theme to effect my Page customizations? Why bother with a custom Page template?Forum: Fixing WordPress
In reply to: Custom Page Templates?One thing I’m still not sure about is how to insert custom javascript into the header of my custom Page Template. I know I can call a
.jsfile that contains my script, but I think that means editing theheader.phpfile of my theme–and that will impact everything, not just the custom Page.Is there anyway to include custom javascript in a custom Page Template?
Forum: Fixing WordPress
In reply to: Custom Page Templates?Thanks esmi. The codex article wasn’t very clear, but I figured it out. You just create a php file in your theme directory (e.g.
/public_html/my-blog-name/wp-content/themes/my-theme-name/page-custom.php) and define the name of the page template in the top of the php file like so:<?php /* Template Name: my-custom-page */ ?>Afterwards, you will see a Template section with dropdown list when you go to Add a New Page. If no custom templates are defined, that section and the dropdown list is not there, which makes it confusing.
Forum: Fixing WordPress
In reply to: URL ScrubbingI agree that a good user experience is not an SEO issue (I never implied that), but I will maintain that URLs are an important part of a website’s UI.
Consider this URL:
http://example.com/weblog/index.php?y=2000&m=11&d=23&id=5678For us humans, it contains meaningless information and is hard to decipher. When URLs are long and complex, they are difficult to repeat or remember. When URLs are clear and intuitive, they provide important clues to what a resource actually contains. Do you think you could repeat that URL above to someone you just met at lunch who wanted to visit your site?
Jakob Nielson (among others) has done research on just how important URLs are:
“We found that searchers are particularly interested in the URL when they are assessing the credibility of a destination. If the URL looks like garbage, people are less likely to click on that search hit. On the other hand, if the URL looks like the page will address the user’s question, they are more likely to click.”
As for portability, a “clean” URL is not dependent on a particular domain or technology. Let’s say I own a domain name with multiple TLD extensions (which I do). I can have my clean URL point to a .com site, or a .net site, or a .org site. And if I rewrite my site in Python or asp.net, then people (and search engines) don’t have to learn a new file extension (.php, .py, .aspx, .htm, etc.).
I’ll defer to the sites I’ve already referenced for how clean URLs improve security and SEO. This “clean” URL debate has been going on for some time.
I guess I never really messed around with the permalink feature in WP. But that sounds like what I’m looking for. I’m pretty good with mod_rewrite so I’m sure I can massage this into something that will meet my needs.
Thanks for the tip.
Forum: Fixing WordPress
In reply to: URL ScrubbingHere’s a good article about mod_rewrite and clear urls.
The point is this:
URLs are an important part of the user interface for a website and should be user friendly.
Other advantages include portabilty, security, and SEO.
Forum: Fixing WordPress
In reply to: URL ScrubbingPerhaps I should have said “clean URLs”
clean:
http://example.net/folder/page.htm
(easy to read, no puctuation or identifiers)dirty:
http://example.net/06052007?p=98
(difficult to read, complex)mod_rewrite is the usual way to accomplish this. Drupal has a module that supports clean urls
Forum: Fixing WordPress
In reply to: wp cacheCan I use this:
define('DISABLE_CACHE', true);in wp-config.php with 2.1.2?
From what I’ve read on this forum, caching in 2.1.2 has been known to cause problems (cpu load, etc.)
Can it be disabled? Is it really all that necessary?
???
Forum: Fixing WordPress
In reply to: Keep sidebar page slection pressedI did this once with PHP. I used a variable in the URL to identify the request, then generated my HTML/CSS accordingly. If I were to do it again, I’d try giving my stylesheet a .php extension and put the logic there.