custom url – add attachment’s id or name after post

Showing links to attachments in the desired format Loop through the attachments and generate the link you want: $args = array( ‘post_type’ => ‘attachment’, ‘numberposts’ => null, ‘post_status’ => null, ‘post_parent’ => $post->ID ); $attachments = get_posts($args); if ($attachments) { foreach ($attachments as $attachment) { echo ‘<a href=”‘ . get_permalink() . ‘video/’ . $attachment->ID . … Read more

database not responding on localhost

Yes, while convenient, let’s rule out the variable of using the $_SERVER[‘HTTP_HOST’] trick and put in the absolute URLs. Here are some handy snippets I use when moving a site (you may want to use these to make sure everything is the same on your install): UPDATE wp_posts SET guid = replace(guid, ‘http://www.olddomain.com’,’http://www.newdomain.com’); UPDATE wp_posts … Read more

URL problem: www.sitename.com/blog and www.sitename.com/learn using same WP installation

Not sure I exactly understand your problem, but it sounds like what you want to do could easily be accomplished using Custom post types: http://codex.wordpress.org/Post_Types#Custom_Types This would basically allow you to have an entire segment just for ‘learn’ completely separated from your general posts/blog – you could even give ‘learn’ it’s own styling by using … Read more

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