Yes, it's THAT book!

Drop your email here to stay informed of the status of my "tell most" book about the National Security Agency:

--OR--

Read a little about the book here:

Employees are allies, not the adversary

--OR--

Check out the Kickstarter here (click)
How can I help you?
Contact Jeremy
Recommendations

Here's something that


I, Jeremy Duffy, actually recommend and think is worth checking out.
No web-bugs, no bs, just a legit recommmendation that I have personally evaluated before allowing it to be listed here:

Think something's here that shouldn't be? contact me!

Hack WordPress to Make Postnames Always Editable

We want to have this postname control no matter what kind of permalink style we actually have.

There's probably a good reason that the WordPress development team took away our ability to modify the page postname (aka slug) when we don't have pretty permalinks active… Yes, a very good reason…

Well forget them! I want to be able to modify a postname no matter what. My development machine doesn't work with pretty permalinks so if I can't edit the postname directly in the edit screen, I have to go straight to the database to do it.

Why do I care? Well a lot of my custom code and heirarchy depends on the postnames. For example, how am I supposed to find all pages that are the child of the page named "Parent" if I can't name the damned page!?

Anyway… enough ranting. Here's the simple hack I found for fixing this vexing issue:

WARNING! I am not a WordPress developer and I have no idea at all if this hack will affect anything else negatively. For all I know, it could trigger nuclear war. Use at your own risk.

  1. Open the "post.php" file in wp-admin\includes
  2. Find these lines:
    function get_sample_permalink_html($id, $new_title=null, $new_slug=null) {
    	$post = &get_post($id);
    	list($permalink, $post_name) = get_sample_permalink($post->ID, $new_title, $new_slug);
    	if (false === strpos($permalink, '%postname%') && false === strpos($permalink, '%pagename%')) {
    		return '';
    	}
    

    Can you see the problem yet? It tests for your permalink style and if it's not "pretty", it dumps out of the function. Easy to fix:

  3. Change it by adding one line as shown here:

    function get_sample_permalink_html($id, $new_title=null, $new_slug=null) {
    	$post = &get_post($id);
    	list($permalink, $post_name) = get_sample_permalink($post->ID, $new_title, $new_slug);
    
    	// Add this line right here!
    	$permalink = get_bloginfo("url")."/%postname%";
    
    	if (false === strpos($permalink, '%postname%') && false === strpos($permalink, '%pagename%')) {
    		return '';
    	}
    
  4. That's it! What we're doing is tricking wordpress into thinking that the page ALWAYS uses pretty permalinks. The rest of the code for editing the postname triggers and viola!

    Advanced search capability with the Geek Professor's very own Jsearch plugin.
    Get File Path to Wordpress Theme.
    Just because you aren't using pretty permalinks doesn't mean you don't want to be able to set a post slug anyway.
    If you're a coder, you may at times need to manually add wordpress posts. Here's how.

    Share This

    Have a Comment or Question?

Loading...

If you want to learn more about my professional background, click here to learn more.

Check out one of my guides/tutorials:

internet safety Tutorial
|INDEX|next: Online Addiction

General Safety

Avoid fake and nasty websites with my search engine trick.
Watch out for online addiction. Getting lost in fun online activities can be just as addiction as any drug.
So you want to write, publish, or share information online? Be careful. Things you say may be lost or forgotten, but things put on the Internet never are.
Don't fall for the well-known (or the new scams either) bad guys use to trick you into give away data or money.

Account Protection

Want to make an account with some online service? Read this first!
The newest, biggest risk online? Account hijacking! Don't become a victim by allowing your account to be taken over and learn to recognize when someone else has been.
Be sure transmission security is active before entering a name, password, credit card number, or other important information online.

... or check out any of my other guides and tutorials by clicking here!

Get File Path to Wordpress Theme

Here's a tip to get the file path to your current Wordpress theme.

[Click for full description]

Hack Wordpress to Make Postnames Always Editable

When using ordinary permalinks, you're blocked from editing the postname when doing posts and pages. This is senseless and must be stopped!

[Click for full description]

Manually Insert Page/Post Into Wordpress Via PHP

If you're a coder, you may at times need to manually add wordpress posts. Here's how.

[Click for full description]

How to Avoid Bogus Websites

There are bogus websites out there hoping you'll hit them by accident or using phishing to trick you into coming to them. Learn my simple trick to avoid these sites!

[Click for full description]

Online Addiction

Concerned about online addiction? You should be. Learn the types, the signs, and the preventions.

[Click for full description]

The Consequences of Posting Online

It's fun to post online. What you think, what you feel. But words typed and posted on the Internet can come back to bite you more than anything you could say with your mouth.

[Click for full description]

Tricks and Scams

Just because you won't willing give up data doesn't mean that I can't trick you out of it. Don't fall for these well known tricks!

[Click for full description]

Account Creation Tips

When you create an account with an online site, you should know a few things first.

[Click for full description]

Account Hijacking

One of the newest threats we face is the risk of someone getting control of your online account and using it against you and the people you know. Do everything you can to prevent that from happening!

[Click for full description]

Using HTTPS For Secure Login and Payment Online

Making online accounts is useful and fun, but doesn't mean much if someone can capture your login information and use it against you. Make sure to use this simple trick to prevent that from happening.

[Click for full description]