How To Make Categories Shows Only The Post Titles
-
Hi! Im no new to WordPress but I have this problem in configuring my categories. I want my categories to show only the Post Titles not the whole post. Anyone can help me out with this? I’ve tried searching the net with this problem but I have no luck to have the right answer. Here is the codes that might help in modification of the .php…
archive.php
<?php
get_header();
if (have_posts())
{
$post = $posts[0];
$title = ”;
if (is_category()){
$title .= single_cat_title(”, true);
} elseif( is_tag() ) {
$title .= sprintf(__(‘Posts Tagged ‘%s’’, THEME_NS), single_tag_title(”, false) );
} elseif( is_day() ) {
$title .= sprintf(_c(‘Archive for %s|Daily archive page’, THEME_NS), get_the_date());
} elseif( is_month() ) {
$title .= sprintf(_c(‘Archive for %s|Monthly archive page’, THEME_NS), get_the_date(‘F Y’));
} elseif( is_year() ) {
$title .= sprintf(_c(‘Archive for %s|Yearly archive page’, THEME_NS), get_the_date(‘Y’));
} elseif( is_author() ) {
$title .= __(‘Author Archive’, THEME_NS);
} elseif( isset($_GET[‘paged’]) && !empty($_GET[‘paged’]) ) {
$title .= __(‘Blog Archives’, THEME_NS);
}
art_page_navi($title);
while (have_posts())
{
art_post();
}
art_page_navi();
} else {
$title = ”;
if ( is_category() ) {
$title .= sprintf(__(“Sorry, but there aren’t any posts in the %s category yet.”, THEME_NS), single_cat_title(”,false));
} else if ( is_date() ) {
$title .= __(“Sorry, but there aren’t any posts with this date.”, THEME_NS);
} else if ( is_author() ) {
$userdata = get_userdatabylogin(get_query_var(‘author_name’));
$title .= sprintf(__(“Sorry, but there aren’t any posts by %s yet.”, THEME_NS), $userdata->display_name);
} else {
$title .= __(‘No posts found.’, THEME_NS);
}
art_not_found_msg($title);
}
get_footer();index.php
<?php
get_header();if (have_posts())
{
while (have_posts())
{
art_post();
}
art_page_navi();
} else {
art_not_found_msg();
}get_footer();
-
You did not specify a blog address or reason for posting when you created this topic.
This support forum is for blogs hosted at WordPress.com. If your question is about a self-hosted WordPress blog then you’ll find help at the WordPress.org forums.
If you don’t understand the difference between WordPress.com and WordPress.org, you may find this information helpful.
If you forgot to include a link to your blog, you can reply and include it below. It’ll help people to answer your question.
This is an automated message.
-
- The topic ‘How To Make Categories Shows Only The Post Titles’ is closed to new replies.