Having some trouble properly displaying Custom Post Types in templates

Three questions per post is not typical; however, as they may all be inter-related I’ll try to help step through each one in turn. The first problem may be simple: When I go to mysite.com/success-stories/, it’s using the default archive.php template. However, I have created a template called archive-successstories.php and it’s being totally ignored. The … Read more

Template setting is not saving in wordpress

Try naming the file page-template-articles.php but leave the file contents and header name – “Template Name: Articles” the same. Right now, you might be running into a reserved naming collision within WP with how Custom Post Type templates are named, i.e. articles-page.php is a page template name for a CPT called articles.

Need a conditional to test if title of parent page matches title of child page

solution here as function: function testchildren () { global $post; $childtest = get_pages(‘child_of=”.$post->ID); if( count( $childtest ) != 0 ) { return false; } else { return true; } } and implementation as markup: <?php if (have_posts()) : while (have_posts()) : the_post() ; ?> <h2><?php $parent_title = get_the_title($post->post_parent); echo $parent_title; ?> </h2> <?php if ( … Read more

Multisite – Echo admins profile meta

According to the Codex, get_user_id_from_string() is deprecated, and should be replaced with get_user_by(). <p> <?php $thisblog = get_current_blog_id(); // probably don’t need this anymore $admin_email = trim( get_option( ‘admin_email’ ) ); $admin_user = get_user_by( ’email’, $admin_email ) ); $phone_number = get_user_meta($admin_user->ID, ‘phone’, true); if($phone_number!=”) { ?> <?php echo $phone_number; ?> <?php } else { ?> … Read more

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