get_permalink() always returns empty

First off, you should use get_posts instead of a raw SQL query. Or at least use $wpdb. <?php $posts = get_posts( array( ‘post_status’ => ‘publish’ ‘numberposts’ => -1 ) ); Then, try passing the entire post object to get_permalink, which saves some database queries. <?php foreach( $posts as $p ) { $link = get_permalink( $p … Read more

How to use different domains for different blogs hosted in the same host in subdomains with .htaccess

You need a vhost for the subdomain that redirects to public_html/sub_domain_folder instead of trying to redirect with .htaccess. You can then do a www redirect in public_html/sub_domain_folder/.htaccess. There should be some option in cpanel when creating the subdomain do specify which folder it directs to if you don’t have direct access to your vhost.

menu link to custom post_type?

ok – got this working with a walker in the end; (added a custom directors link to the menu) class Director_nav_links extends Walker_Nav_Menu { function start_el(&$output, $item, $depth, $args) { global $wp_query; $indent = ( $depth ) ? str_repeat( “\t”, $depth ) : ”; $class_names = $value=””; $classes = empty( $item->classes ) ? array() : … Read more