Blog Post titles are not showing on wordpress blog page

by setjo
8 replies
hi
Why the posts titles are not showing on Blog page.
Instead of posts titles only post content is shown.

Blog

Titles are not shown in all posts

Latest News About Plastic Surgery | Plastic Surgery Doctor | Cosmetic Surgeon in Stuart, Jupiter FL

Sample Post 2 | Plastic Surgery Doctor | Cosmetic Surgeon in Stuart, Jupiter FL
#blog #page #post #showing #titles #wordpress
  • Profile picture of the author IdeaBox
    Edit your post page and make sure you're calling get_the_title()

    something like
    Code:
    <h1><?php get_the_title() ?></h1>
    {{ DiscussionBoard.errors[8446737].message }}
  • Profile picture of the author yestyle
    Banned
    You missed title tage in wordpress post template. you need to find default template post and add it again.
    {{ DiscussionBoard.errors[8446778].message }}
    • Profile picture of the author setjo
      In the index.php h2 is calling title

      <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>

      Pl help me in which file do I have to change
      {{ DiscussionBoard.errors[8446848].message }}
  • Profile picture of the author Mohsin Rasool
    Originally Posted by setjo View Post

    hi
    Why the posts titles are not showing on Blog page.
    Instead of posts titles only post content is shown.

    Blog

    Titles are not shown in all posts

    Latest News About Plastic Surgery | Plastic Surgery Doctor | Cosmetic Surgeon in Stuart, Jupiter FL

    Sample Post 2 | Plastic Surgery Doctor | Cosmetic Surgeon in Stuart, Jupiter FL

    There must be some theme function/setting in your themes panel which have this option
    to turn off/on the titles of posts/pages. If you custom coded this theme yourself then
    you surely need to have title tag included as told already above by fellow friends.

    Kind Regards,
    Mohsin
    {{ DiscussionBoard.errors[8446855].message }}
    • Profile picture of the author setjo
      I have checked all the settings but not found any issue

      Here is the setting of dashboard > Reading

      Front page: Home
      Posts page: Blog
      Blog pages show at most 10 posts
      Syndication feeds show the most recent 10 items
      For each article in a feed : Summary

      Pl help me out

      If you want I can copy and paste the code here.
      {{ DiscussionBoard.errors[8446909].message }}
      • Profile picture of the author setjo
        Here is the content of index.php, header.php and functions.php
        index.php
        <?php

        get_header();



        if(have_posts()) {



        if(is_search()) echo " <h1>Search results for '".get_search_query()."'</h1>\n";



        while(have_posts()) {

        the_post();



        if(is_search()) {

        ?>

        <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>

        <p><?php $a = get_the_excerpt(); echo (substr($a, -6) == " [...]") ? substr($a, 0, -6)."..." : $a; ?> <a href="<?php the_permalink(); ?>">Read more</a></p>

        <div class="hr"></div>

        <?php } else { ?>

        <?php the_content(); ?>

        <?php

        }

        }

        ?>

        <?php simple_pagination(); ?>

        <?php

        } else {

        echo " <h1>".(is_search() ? "No search results for '".get_search_query()."'" : "Page not found")."</h1>\n";

        }

        get_sidebar();



        get_footer();

        ?>


        -------------------------------------------------------------------
        And header.php

        <!DOCTYPE html>

        <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php bloginfo("language"); ?>" lang="<?php bloginfo("language"); ?>">



        <head>

        <title><?php wp_title(false); if(wp_title(" ", false)) echo " &ndash; "; bloginfo("name"); ?></title>

        <meta name="google-site-verification" content="A3cPOqKPvrlwvHof9mXA_BTV266QiM1JBSnG7yI8d vI" />

        <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=<?php bloginfo("charset"); ?>" />

        <meta http-equiv="Content-Language" content="<?php bloginfo("language"); ?>" />

        <!-- <meta http-equiv="Description" content="<?php echo is_front_page() ? get_bloginfo("description") : simple_description($post); ?>" />

        <meta property="og:description" content="<?php echo is_front_page() ? get_bloginfo("description") : simple_description($post); ?>" /> -->

        <meta property="og:image" content="<?php bloginfo("template_directory"); ?>/screenshot.png" />

        <link rel="image_src" href="<?php bloginfo("template_directory"); ?>/screenshot.png" />

        <link rel="stylesheet" type="text/css" href="<?php bloginfo("stylesheet_url"); ?>" />

        <link rel="stylesheet" type="text/css" href="<?php bloginfo("template_directory"); ?>/style/plugins/prettyphoto/css.css" />

        <link rel="shortcut icon" href="<?php bloginfo("template_directory"); ?>/style/favicon.ico" />

        <script type="text/javascript" src="<?php bloginfo("template_directory"); ?>/style/js-jquery.js"></script>

        <script type="text/javascript" src="<?php bloginfo("template_directory"); ?>/style/plugins/prettyphoto/js.js"></script>

        <script type="text/javascript" src="<?php bloginfo("template_directory"); ?>/style/js.js"></script>

        <?php wp_head(); ?>

        </head>



        <body>

        <div id="header">

        <div id="header_wrap">

        <a id="header_logo" href="<?php bloginfo("wpurl"); ?>"></a>



        <?php $def = "Search..."; $searched = (isset($_GET['s']) && $_GET['s'] != $def); ?>

        <div class="header_control" id="header_search" data-target="<?php bloginfo("wpurl"); ?>">

        <input class="input_<?php if(!$searched) echo "in"; ?>active" type="text" value="<?php echo $searched ? htmlspecialchars($_GET['s']) : $def; ?>" data-default="<?php echo $def; ?>" />

        <a class="header_control_icon" href="javascript:void(0)"></a>

        </div>



        <div class="header_control" id="header_contact">

        <div class="left"><strong>Call</strong> 772 324 8197</div>

        <div id="header_contact_div"></div>

        <a id="header_contact_fb" class="header_control_icon" href="http://www.facebook.com/pages/Avron-H-Lipschitz-MD-Plastic-Surgery-LLC/310968198950457" target="_blank"></a>

        <?php // <a id="header_contact_tw" class="header_control_icon" href="http://twitter.com/" target="_blank"></a> ?>

        <?php // <a id="header_contact_in" class="header_control_icon" href="http://www.linkedin.com/" target="_blank"></a> ?>

        </div>



        <div id="header_menu">

        <?php

        foreach(get_menu_items("mainmenu") as $item) {

        $active = menu_item_is_active($item); $subactive = false; $sub = "";



        if(isset($item->submenu)) {

        $echo = "";

        foreach($item->submenu as $subitem) {

        $subitemactive = menu_item_is_active($subitem);

        if($subitemactive) $subactive = true;

        $echo .= "<a class=\"header_menu_sub_item".($subitemactive ? " header_menu_sub_item_active" : "")."\" href=\"{$subitem->custom_URL}\">{$subitem->custom_title}</a>";

        }

        echo " <div class=\"header_menu_sub\"><div class=\"header_menu_sub_corner\"></div>{$echo}</div>\n";

        }

        echo " <a class=\"header_menu".($active || $subactive ? " header_menu_active" : "")."\" href=\"{$item->custom_URL}\">{$item->custom_title}</a>\n";

        }

        ?>

        </div>

        </div>

        </div>



        <div id="contentbg">

        <div id="contentface"></div>

        <table id="contenttable" cellpadding="0" cellspacing="0">

        <tr valign="top">

        <td id="content">

        --------------------------------------------------------------------------
        functions.php

        <?php
        register_nav_menu("mainmenu", "Main menu");
        register_sidebar(array("name"=>"Sidebar", "id"=>"mainsidebar", "description"=>"Right-hand sidebar", "before_widget"=>"<div class=\"sidebarwidget\">", "after_widget"=>"</div>", "before_title"=>"<h2>", "after_title"=>"</h2>"));

        function get_menu_items($name) {
        if(($a = get_nav_menu_locations()) && isset($a[$name])) {$a = wp_get_nav_menu_object($a[$name]); $b = wp_get_nav_menu_items($a->term_id);}
        if(!isset($b) || !$b || count($b) === 0) $b = get_pages(array("sort_column"=>"menu_order"));

        // Support first level submenus
        $children = array();
        foreach($b as $c => $d) {
        $parent = intval(isset($d->menu_item_parent) ? $d->menu_item_parent : $d->post_parent);
        if($parent > 0) {
        if(isset($children[$parent])) $children[$parent][] = $d; else $children[$parent] = array($d);
        unset($b[$c]);
        }
        $d->custom_ID = isset($d->object_id) ? $d->object_id : $d->ID;
        $d->custom_URL = isset($d->url) ? $d->url : get_permalink($d->custom_ID);
        $d->custom_title = $d->title ? $d->title : $d->post_title;
        }
        foreach($b as $c) if(isset($children[$c->ID])) $c->submenu = $children[$c->ID];

        return $b;
        }

        function menu_item_is_active($item) {
        global $wp_query;
        $url = "http".($_SERVER['HTTPS'] == "on" ? "s" : "")."://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
        return ($item->custom_ID == $wp_query->post->ID || $item->custom_URL == $url);
        }

        function get_breadcrumbs($sep = "&raquo;") {
        if(is_front_page() || is_home()) return get_bloginfo("name");

        $return = "<a href=\"".get_bloginfo("wpurl")."\">".get_bloginfo( "name")."</a>";

        if(is_search()) return $return." {$sep} Search results";

        global $wp_query;
        $post = $current_post = $wp_query->post;

        // Create posts array
        $array = array();
        while($post->post_parent > 0) {$post = get_post($post->post_parent); $array[] = $post;}
        array_reverse($array);

        // Format string
        foreach($array as $post) $return .= " {$sep} <a href=\"".get_permalink($post->ID)."\">{$post->post_title}</a>";
        return $return." {$sep} ".$current_post->post_title;
        }

        function simple_description($post, $len = 30, $tags = "", $postfix = "...") {
        if(is_int($post)) $post = get_post($post);
        else if(!is_object($post)) return false;

        $a = has_excerpt($post->ID) ? $post->post_excerpt : $post->post_content;
        $a = strip_shortcodes(strip_tags(stripslashes($a), $tags));
        $b = preg_split("/\b/", $a, $len*2+1);
        array_pop($b);

        return (count($b) == 0) ? false : implode($b).$postfix;
        }

        function simple_pagination($pages = false, $range = 2) {
        $showitems = ($range * 2) + 1;

        global $paged;
        if(empty($paged)) $paged = 1;

        if($pages === false) {
        global $wp_query;
        $pages = $wp_query->max_num_pages;
        if(!$pages) $pages = 1;
        }

        if($pages == 1) return false;

        echo "<div class=\"pagination\"><div class=\"paginationwrap\">";
        if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "<a href=\"".get_pagenum_link(1)."\">&laquo;</a>";
        if($paged > 1 && $showitems < $pages) echo "<a href=\"".get_pagenum_link($paged - 1)."\">&lsaquo;</a>";

        for($i = 1; $i <= $pages; $i++) if(1 != $pages && (!($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems ))
        echo ($paged == $i) ? "<span class=\"paginationcurrent\">{$i}</span>" : "<a href=\"".get_pagenum_link($i)."\">{$i}</a>";

        if($paged < $pages && $showitems < $pages) echo "<a href=\"".get_pagenum_link($paged+1)."\">&rsaquo;</a>";
        if($paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages) echo "<a href=\"".get_pagenum_link($pages)."\">&raquo;</a>";
        echo "</div><div class=\"clear\"></div></div>\n";
        }
        ?>
        {{ DiscussionBoard.errors[8446950].message }}
  • Profile picture of the author Mohsin Rasool
    Do you have single.php file?

    Can you pm me or email me your login info, I look into it and solve right there.

    Thank you
    {{ DiscussionBoard.errors[8447713].message }}
    • Profile picture of the author setjo
      thanks a million. I will PM you login details ASAP
      {{ DiscussionBoard.errors[8449843].message }}

Trending Topics