1
當我在其中一個網站帖子的底部點擊「閱讀更多」時,它只是將其餘文本加載到同一頁面和同一部分,從而使文本和破壞我的佈局。我注意到,在每個Wordpress帖子末尾有一個<!--more-->
標籤,當從工具欄添加「閱讀更多內容」時。如何覆蓋此標記的默認行爲,以便在用戶單擊「更多...」以查看帖子時打開新頁面? 更新:
發佈內容使用jQuery代碼從名爲tazeha.php的php文件中加載。
tazeha.php
如何更改<!--more--> Wordpress中的行爲
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css"/>
<?php
require('wp-config.php');
?>
</head>
<body>
<?php
$cat_id=get_cat_ID('تازه ها');
$posts = get_posts ("cat=$cat_id&posts_per_page=1");
if ($posts)
{
foreach ($posts as $post):
setup_postdata($post); ?>
<h2><?php the_title(); ?></h2>
<?php the_content();?>
<?php endforeach;
}
?>
</body>
</html>
我可以改變上面的代碼,這樣一個帖子「的」標籤後的文本在新的瀏覽器頁面(標籤)打開了?
你應該在這裏http://wordpress.stackexchange.com/發佈的WordPress問題 – KRUKUSA 2014-10-20 08:22:36
謝謝,BU我想這可能更多的是PHP的問題,而不是wordpress的。 – JasonStack 2014-10-20 08:23:27
然後我們需要看到php代碼。 – KRUKUSA 2014-10-20 08:23:55