嗨,大家好我張貼的問題提早了我的博客文章如何保持替換WordPress的 https://stackoverflow.com/questions/20541544/why-do-my-recent-post-titles-replace-the-page-title-i-am-posting-on/20542610?noredirect=1#20542610 我的網頁標題,但我不明白我的問題得到了答覆的方式,因爲我沒有PHP經驗所以我認爲id在這裏發佈我的代碼,所以如果任何人可以針點在wordpress代碼它有一個錯誤? 這是在其標題爲「最新消息」將被替換爲什麼我的文章標題代替我的網頁標題
<?php
/**
* The template for displaying all pages.
*
* This is the template that displays all pages by default.
* Please note that this is the wordpress construct of pages
* and that other 'pages' on your wordpress site will use a
* different template.
*
*/
?>
<?php get_header(); ?>
<div class="page-heading">
<h1 class="page-title"><?php the_title(); ?></h1>
<div class="clear"></div>
</div>
<!--Start Page Content -->
<div class="page-content-container">
<div class="page-content">
<div class="grid_16 alpha">
<div class="content-bar">
<?php if (have_posts()) : the_post(); ?>
<?php the_content(); ?>
<div class="clear"></div>
<?php wp_link_pages(array('before' => '<div class="page-link"><span>' . __('Pages:', 'black-bird') . '</span>', 'after' => '</div>')); ?>
<?php endif; ?>
<!--Start Comment box-->
<?php comments_template(); ?>
<!--End Comment box-->
</div>
</div>
<div class="grid_8 omega">
<!--Start Sidebar-->
<?php get_sidebar(); ?>
<!--End Sidebar-->
</div>
</div>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>
頁面的代碼,這是對職位代碼的每一個新的帖子標題替換頁面標題
<?php
/**
* The Template for displaying all single posts.
*
*/
?>
<?php get_header(); ?>
<!--Start Page Heading-->
<!--Start Page Content -->
<div class="page-content-container">
<div class="page-content single">
<div class="grid_16 alpha">
<div class="content-bar">
<!-- Start the Loop. -->
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<!--post start-->
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="post_content">
<?php the_content(); ?>
<div class="clear"></div>
<h1 class="post_title single" ><span><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(esc_attr__('Permalink to %s', 'black-bird'), the_title_attribute('echo=0')); ?>"><?php the_title(); ?></a><span></h1>
<?php wp_link_pages(array('before' => '<div class="page-link"><span>' . __('Pages:', 'black-bird') . '</span>', 'after' => '</div>')); ?>
<?php if (has_tag()) { ?>
<div class="tag">
<?php the_tags(__('Post Tagged with ', ', ', '')); ?>
</div>
<?php } ?>
</div>
<ul class="post_meta clearfix">
<li class="posted_by"><span><?php _e('Posted by', 'black-bird'); ?></span> <img src="<?php echo get_template_directory_uri(); ?>/images/admin.png" /><?php the_author_posts_link(); ?></li>
<li class="post_category"><span><?php _e('Posted in', 'black-bird'); ?></span> <?php the_category(', '); ?></li>
<li class="post_date"><img src="<?php echo get_template_directory_uri(); ?>/images/date.png" /> <?php echo get_the_time('M, d, Y') ?></li>
<li class="post_comment"><img src="<?php echo get_template_directory_uri(); ?>/images/comment.png" /> <span><?php comments_popup_link('No Comments.', '1 Comment.', '% Comments.'); ?></span></li>
</ul>
</div>
<!--End Post-->
<?php
endwhile;
else:
?>
<div class="post">
<p>
<?php _e('Sorry, no posts matched your criteria.', 'black-bird'); ?>
</p>
</div>
<?php endif; ?>
<!--End Loop-->
<nav id="nav-single"> <span class="nav-previous">
<?php previous_post_link('%link', __('<span class="meta-nav">←</span> Previous Post ', 'black-bird')); ?>
</span> <span class="nav-next">
<?php next_post_link('%link', __('Next Post <span class="meta-nav">→</span>', 'black-bird')); ?>
</span> </nav>
<!--Start Comment box-->
<?php comments_template(); ?>
<!--End Comment box-->
</div>
</div>
<div class="grid_8 omega">
<!--Start sidebar-->
<?php get_sidebar(); ?>
<!--End sidebar-->
</div>
</div>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>
也這是頭文件的代碼
<?php
/**
* The Header for our theme.
*
* Displays all of the <head> section and everything up till <div id="main">
*
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo('charset'); ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<title><?php wp_title(''); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo('stylesheet_url'); ?>" />
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?> style="<?php if (blackbird_get_option('blackbird_bodybg') != '') { ?>background: fixed url(<?php echo blackbird_get_option('blackbird_bodybg'); ?>);<?php } else {
?> background: fixed url(<?php echo get_template_directory_uri(); ?>/images/bg.jpg); <?php } ?>" >
<div class="main-container">
<div class="container_24">
<div class="grid_24">
<div class="header">
<div class="grid_16 alpha">
<div class="logo"> <a href="<?php echo home_url(); ?>"><img src="<?php if (blackbird_get_option('blackbird_logo') != '') { ?><?php echo blackbird_get_option('blackbird_logo'); ?><?php } else { ?><?php echo get_template_directory_uri(); ?>/images/logo.png<?php } ?>" alt="<?php bloginfo('name'); ?>" /></a></div>
</div>
<div class="grid_8 omega">
<div class="header-info">
<?php if (blackbird_get_option('blackbird_topright_cell') != '') { ?>
<p class="cell"><img src="<?php echo get_template_directory_uri(); ?>/images/call-us.png" class="call-us" /> <?php echo stripslashes(blackbird_get_option('blackbird_topright_cell')); ?></p>
<?php } else { ?>
<p class="cell"><img src="<?php echo get_template_directory_uri(); ?>/images/call-us.png" class="call-us" /> Call Us (111) 234 - 5678</p>
<?php } ?>
<?php if (blackbird_get_option('blackbird_topright_text') != '') { ?>
<p><?php echo stripslashes(blackbird_get_option('blackbird_topright_text')); ?></p>
<?php } else { ?>
<p><?php _e('21/B, London Campus, British Road, Birmingham, UK','black-bird'); ?></p>
<?php } ?>
</div>
</div>
</div>
<div class="clear"></div>
<!--start Menu wrapper-->
<div class="menu_wrapper">
<div class="grid_18 alpha">
<div id="MainNav">
<a href="#" class="mobile_nav closed"><?php _e('Pages Navigation Menu','black-bird'); ?><span></span></a>
<?php blackbird_nav(); ?>
</div></div>
<div class="grid_6 omega">
<div class="top-search">
<?php get_search_form(); ?>
</div>
</div>
</div>
<!--End Menu wrapper-->
<div class="clear"></div>
這樣的傢伙我需要做什麼改變,並分別以每個帖子標題停止更換頁面的標題?
,你的意思是'或者實際的'
在wordpress中添加txt時,給出了兩個空白框,一個標題出現的小框,然後內容越大越好,所以我很關心這個標題,或者是那個較小的博客x爲內容的標題框 – user2608169