Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am very new to WordPress. How can I use post custom metadata in place of Post Titles, and as the Post Permalink? For example, instead of domain.com/the-post-title, the permalink would be domain.com/$postcustommetadata.

I posted my idea in the WPORG support forums. I have a general idea, but don't know how to implement it, because I don't yet fully understand WordPress conventions, classes, etc.

Thanks

Plzz HeLp

share|improve this question
2  
Please go back and rewrite your post in a way where you don't need to use uppercase (shouting) characters. This is for later readers too. Thanks. –  kaiser Oct 7 '11 at 21:25
    
I don't understand the downvotes for the question? This sounds like a valid question. Perhaps the downvotes are due to the way the question is written? If so: consider that English may not be the OP's first language. :) –  Chip Bennett Oct 7 '11 at 22:20
    
Please Someone help i found here very big wordpress coder and i think I can Get help from your side if you don't understand my idea i can explain it again more clearly please help out –  realcoder Oct 8 '11 at 14:04
2  
What you're asking for is a fairly advanced WordPress topic, and likely involves familiarity with the WordPress Rewrite API. –  Chip Bennett Oct 18 '11 at 11:27
2  
And please improve your accept rate 0% is unacceptable. –  soulseekah Oct 18 '11 at 11:53
show 1 more comment

2 Answers 2

This will do.

The slug is saved on the wp_posts while custom fields are on the wp_posts_meta. If you want to make it like that you can use an action hook on save_post that will get the value of the custom fields and saves it as the post slug.

Here is the code

add_action('save_post', 'set_slug');

function set_slug($post_id){
    $new_slug = get_post_meta($post_id,'custom-slug', true);    
    $post_args = array(
        'ID' => $post_id,
        'post_name' => $new_slug,
    );

    wp_update_post($post_args);
}
share|improve this answer
add comment

If you're looking for customizing the permalink for specific posts, pages or categories, try the Custom Permalinks plugin. I've had much success with it before.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.