How can I redirect this contact form to a specific permalink

If your form has been incorporated into WordPress as a page template, which I encourage, then get_permalink(8); // or 12 should do it. If not, then http://example.com/?p=8 and http://example.com/?p=12 should always work. http://example.com/?page_id=8 and http://example.com/?page_id=12 uses the proper parameter for pages but ?p= works fine when I test it.

implement separate templates for 1 post type

You may use template redirect action to check if there is parameter set for description and based on that you can show desired template. <?php add_action(‘template_redirect’, ‘course_template_redirect’, 1); function course_template_redirect() { global $wp_query; if($wp_query->post_type==’courses’ and $_REQUEST[‘showdesc’]==’1′) { //include your template from your theme folder. for e.g include(‘mytheme/coursetemplate.php’); } } ?>

Using one slug/post-name for multiple pages

This is not natively possible, since in your example permalink structure posts are detected by slug alone, and not combination with category. Essentially category info gets simply discarded. If your requirements involve only one (few) of possible endings for URL you might achieve this relatively easy using endpoints, see add_rewrite_endpoint(). However in generic scenario slug … Read more

Permalink Settings

mod_rewriteis probably not activated on your localhost that why permalink can’t work. Just uncomment this line in apache : #LoadModule rewrite_module modules/mod_rewrite.so

Suddenly new posts have the default permalink instead of the post name

Nothing just happens for “no apparent reason”. Some new condition has caused this. Most likely a new plugin or update of an existing plugin. It is possible for a plugin or theme doing something crazy like flushing rewrite rules on every load could wipeout the existing rules. See this ticket for more info: http://core.trac.wordpress.org/ticket/18450#comment:34 if … Read more

How to link the title adding a permalink?

Following your code strictly you’d want … $dl .= ‘<dt><a href=”‘.get_permalink($wp_query->post->ID).'”>’ . $wp_query->post->post_title . ‘</a></dt>’; … but you are using the WP_Query object in a very atypical way. You are sort-of brute forcing your way through the Loop instead of using the methods and template functions built into the core. For example: while ( $query->have_posts() … Read more

Can WP give a value a post ID?

Add a rewrite rule and extra query vars to handle incoming requests, direct the rewrite rule to a single page post type, create a custom page template for that page, then do whatever querying you need using the query vars set by your rewrite rule.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)