why doesn’t the_content() work in this {single-custom_post_type.php} page?

Some post-related data is not available to get_posts by default, such as post content through the_content(), or the numeric ID. This is resolved by calling an internal function setup_postdata(), with the $post array as its argument: <?php $args = array( ‘posts_per_page’ => 3 ); $lastposts = get_posts( $args ); foreach ( $lastposts as $post ) … Read more

Echo author ID in author.php

Try this code. $author = get_user_by( ‘slug’, get_query_var( ‘author_name’ ) ); echo $author->ID; Alternatively, if author name has not been set use: if ( $author_id = get_query_var( ‘author’ ) ) { $author = get_user_by( ‘id’, $author_id ); } credit @AndyAdams in the easily missed comments bellow

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