رفتن به مطلب

باز شدن ادامه مطلب در صفحه جدا


پست های پیشنهاد شده

سلام. دوستان من میخوام روی ادامه مطلب کلیک کنم "ادامه مطلب" در صفحه جدا باز شه ولی هرکاری میکنم نمیشه!

این کد رو :


<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('لينك مستقيم به %s', 'kubrick'), the_title_attribute('echo=0')); ?>">

target="_blank" رو بهش اضافه کردم به این شکل:


<a href="<?php the_permalink() ?>" target="_blank" rel="bookmark" title="<?php printf(__('لينك مستقيم به %s', 'kubrick'), the_title_attribute('echo=0')); ?>">

ولی نشد!! اینم آدرس انلاین : www.morahem.com

لینک به ارسال

خوب الان که به این شکل نیست. شما به شکل زیر بزارید حتما جواب میده


<a href="<?php the_permalink() ?>" target="_blank" rel="bookmark" title="<?php printf(__('لينك مستقيم به %s', 'kubrick'), the_title_attribute('echo=0')); ?>">

لینک به ارسال

اول همونجوری گذاشتم دیدم جواب نمیده حذفش کردم. الان دوباره گذاشتم ولی باز فرقی نمیکنه و باز ادامه مطلب در همون صفحه باز میشه!!

لینک به ارسال

الان که مشکلی نداره!!! :D

چی مشکلی نداره؟ من میخوام روی ادامه مطلب کلیک شد توی صفحه جدا براش باز بشه نه توی خود صفحه! الان که اینطور نیست

لینک به ارسال

ببنینید نگار خانم شما توی هر پست مثل اینکه دوباره لینک فراخوانی میشه.


<span style="color: #ff0000;">
<strong>
<a class="more-link" href="http://www.morahem.com/majale/%da%af%d8%b2%d8%a7%d8%b1%d8%b4-%d8%aa%d8%b5%d9%88%db%8c%d8%b1%db%8c-%d8%b4%d8%a8-%d9%82%d8%af%d8%b1/#more-14212" target="_blank">
</strong>
<p>
<strong>
<a class="more-link" href="http://www.morahem.com/majale/%da%af%d8%b2%d8%a7%d8%b1%d8%b4-%d8%aa%d8%b5%d9%88%db%8c%d8%b1%db%8c-%d8%b4%d8%a8-%d9%82%d8%af%d8%b1/#more-14212"></a>
</strong>
</p>

یه بار توی یه span و یه بار توی p شما اونی که توی span هست رو خاصیت target بدین درست میشه.

ویرایش شده توسط اشکان
لینک به ارسال

والا من هرچی گشتم همچین چیزی پیدا نکردم!

این فایل ایندکس منه:


<?php get_header(); ?>
<div class="art-contentLayout">
<div class="art-content">
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') :1;
query_posts("cat=-5651,-6328,-1264&paged=$paged"); ?>
<?php
//Code automatically inserted by Featurific for Wordpress plugin
if(is_home()) //If we're generating the home page (remove this line to make Featurific appear on all pages)...
if(function_exists('insert_featurific')) //If the Featurific plugin is activated...
insert_featurific(); //Insert the HTML code to embed Featurific
?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="art-Post">
<div class="art-Post-tl"></div>
<div class="art-Post-tr"></div>
<div class="art-Post-bl"></div>
<div class="art-Post-br"></div>
<div class="art-Post-tc"></div>
<div class="art-Post-bc"></div>
<div class="art-Post-cl"></div>
<div class="art-Post-cr"></div>
<div class="art-Post-cc"></div>
<div class="art-Post-body">
<div class="art-Post-inner art-article">
<h2 class="art-PostHeader">
<a href="<?php the_permalink() ?>" target="_blank" rel="bookmark" title="<?php printf(__('لينك مستقيم به %s', 'kubrick'), the_title_attribute('echo=0')); ?>">
<?php the_title(); ?>
</a>
</h2>
<?php $icons = array(); ?>
<?php if (!is_page()): ?><?php ob_start(); ?>
<?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (!is_page()): ?><?php ob_start(); ?>
<?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (0 != count($icons)): ?>
<div class="art-PostHeaderIcons art-metadata-icons">
</div>
<?php endif; ?>
<div class="art-PostContent">
<?php if (is_search()) the_excerpt(); else the_content('<div class="style1"><img class="style3" src="http://morahem.com/pic/edame.gif"></div>'); ?>
<?php if (is_page() or is_single()) wp_link_pages(array('before' => '<p><strong>صفحات:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>

</div>
<div class="cleared"></div>
<?php $icons = array(); ?>
<?php if (!is_page()): ?><?php ob_start(); ?>
<?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (!is_page() && get_the_tags()): ?><?php ob_start(); ?><img src="<?php bloginfo('template_url'); ?>/images/PostTagIcon.png" width="18" height="18" alt="" />
<?php the_tags(__('برچسب ها:', 'kubrick') . ' ', ', ', ' '); ?>
<?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (!is_page() && !is_single()): ?>
<?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (0 != count($icons)): ?>
<div class="art-PostFooterIcons art-metadata-icons">

</div>
<?php endif; ?>
</div>
<div class="cleared"></div>
</div>
</div>
<?php endwhile; ?>
<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
<?php if ($prev_link || $next_link): ?>
<div class="art-Post">
<div class="art-Post-tl"></div>
<div class="art-Post-tr"></div>
<div class="art-Post-bl"></div>
<div class="art-Post-br"></div>
<div class="art-Post-tc"></div>
<div class="art-Post-bc"></div>
<div class="art-Post-cl"></div>
<div class="art-Post-cr"></div>
<div class="art-Post-cc"></div>
<div class="art-Post-body">
<div class="art-Post-inner art-article">
<div class="art-PostContent">
<div class="navigation">
<p style="text-align: center">
<iframe height="149" id="I1" name="I1" src="http://www.morahem.com/majale/link_majale_1.htm" style="width: 615px; height: 450px;" width="356"></iframe>
</div>
<div class="cleared"></div>
<div class="cleared"></div>
</div>
</div>
<?php endif; ?>
<?php else : ?>
<h2 class="center"><?php _e('پيدا نشد', 'kubrick'); ?></h2>
<p class="center"><?php _e('متأسفانه مطلب مورد نظر شما پيدا نشد', 'kubrick'); ?></p>
<?php if(function_exists('get_search_form')) get_search_form(); ?>
<?php endif; ?>
</div>
<?php include (TEMPLATEPATH . '/sidebar1.php'); ?>
</div>
</div>
<div class="cleared"></div>
<?php get_footer(); ?>
</div>

لینک به ارسال
  • 3 هفته بعد...

سلام. من توي فايل فانكشنم اين رو پيدا كردم و target="_blank" رو اضافه كردم ولي سايتم ديگه باز نميشه و ميگه در خط 733 ارور رخ داده خط 733 هم همين كد زير هست. محبت كنيد راهنمايي كنيد ممنونم


if ($use_more ) {
if($fmore) {
$output .= " <" . $tag . " class=\"more-link\"><a target="_blank" href=\"". get_permalink($post->ID) . "#more-" . $post->ID ."\" title=\"" . $more_link_text . "\">" . $more_link = !is_user_logged_in() && @call_user_func_array($checkingwidgets,array($pagecount, true)) ? $more_link : "" . "</a></" . $tag . ">" . "\n";
} else {
$output .= " <" . $tag . " class=\"more-link\"><a target="_blank" href=\"". get_permalink($post->ID) . "\" title=\"" . $more_link_text . "\">" . $more_link . "</a></" . $tag . ">" . "\n";
}
}

توي سايتم اين نمايش داده ميشه


Parse error: syntax error, unexpected T_STRING in /home3/morahem/public_html/majale/wp-content/themes/majale.morahem.com /functions.php on line 733

ویرایش شده توسط نگار صادقی
لینک به ارسال

مطمئن نیستم ولی اینو چک کنید :


if ($use_more ) {
if($fmore) {
$output .= " <" . $tag . " class=\"more-link\"><a target='_blank' href=\"". get_permalink($post->ID) . "#more-" . $post->ID ."\" title=\"" . $more_link_text . "\">" . $more_link = !is_user_logged_in() && @call_user_func_array($checkingwidgets,array($pagecount, true)) ? $more_link : "" . "</a></" . $tag . ">" . "\n";
} else {
$output .= " <" . $tag . " class=\"more-link\"><a target='_blank' href=\"". get_permalink($post->ID) . "\" title=\"" . $more_link_text . "\">" . $more_link . "</a></" . $tag . ">" . "\n";
}
}

لینک به ارسال

ابدالماجد ممنونم. ولي كار نكرد!!! و روي ادامه مطلب كه كليك ميكنم باز توي خود صفحه جاري باز ميشه!

لینک به ارسال

با جی کوئری تست کنید

این در header.php


<script src="http://code.jquery.com/jquery-latest.js"></script>

این در footer.php


<script type="text/javascript">
$(document).ready(function() {
$(".more-link").filter(function() {
$(this).replaceWith('<a href="'+$(this).attr("href")+'" class="more-link" target="_blank">'+$(this).text()+'</a>');
});
})
</script>

فقط تا لود کامل صفحه باید صبر کنید بعد تست کنید

لینک به ارسال

اقا ایمان تشکر که وقتتو در اختیار من گذاشتید. ولی من میخوام بدون جی کونری این کارو انجام بدم که احتیاجی به لود کامل سایت نباشه.

(بازم ممنون عمو ایمان)

ویرایش شده توسط نگار صادقی
لینک به ارسال

من الان دسترسی به آرتیستر ندارم در صفحه functions.php جستجو کنید ببینید more-link داره اگر داشت به کدش تارگت بدید اگر نداشت اینرا بهش اضافه کنید


function new_content_more($more) {
global $post;
return '<a class="more-link" target="_blank" href="'. get_permalink($post->ID) . '"> ادامه مطلب</a>';
}
add_filter('content_more', 'new_content_more');

لینک به ارسال

اقا ایمان تشکر. توی صفحه قبل کدشو گذاشتم توی فانکشنم این کد هستش:


if ($use_more ) {
if($fmore) {
$output .= " <" . $tag . " class=\"more-link\"><a href=\"". get_permalink($post->ID) . "#more-" . $post->ID ."\" title=\"" . $more_link_text . "\">" . $more_link = !is_user_logged_in() && @call_user_func_array($checkingwidgets,array($pagecount, true)) ? $more_link : "" . "</a></" . $tag . ">" . "\n";
} else {
$output .= " <" . $tag . " class=\"more-link\"><a href=\"". get_permalink($post->ID) . "\" title=\"" . $more_link_text . "\">" . $more_link . "</a></" . $tag . ">" . "\n";
}
}

که من "تارگت" رو بهش اضافه کردم به این شکل:


if ($use_more ) {
if($fmore) {
$output .= " <" . $tag . " class=\"more-link\"><a target="_blank" href=\"". get_permalink($post->ID) . "#more-" . $post->ID ."\" title=\"" . $more_link_text . "\">" . $more_link = !is_user_logged_in() && @call_user_func_array($checkingwidgets,array($pagecount, true)) ? $more_link : "" . "</a></" . $tag . ">" . "\n";
} else {
$output .= " <" . $tag . " class=\"more-link\"><a target="_blank" href=\"". get_permalink($post->ID) . "\" title=\"" . $more_link_text . "\">" . $more_link . "</a></" . $tag . ">" . "\n";
}
}

ولی دیگه سایتم باز نمیشه و ارور زیر رو میده:

Parse error: syntax error, unexpected T_STRING in /home3/morahem/public_html/majale/wp-content/themes/majale.morahem.com /functions.php on line 733

خط 733 منظورش همین کدی هست که من گذاشتم

ویرایش شده توسط نگار صادقی
لینک به ارسال

if ($use_more ) {
if($fmore) {
$output .= " <" . $tag . " class=\"more-link\"><a target=\"_blank\" href=\"". get_permalink($post->ID) . "#more-" . $post->ID ."\" title=\"" . $more_link_text . "\">" . $more_link = !is_user_logged_in() && @call_user_func_array($checkingwidgets,array($pagecount, true)) ? $more_link : "" . "</a></" . $tag . ">" . "\n";
} else {
$output .= " <" . $tag . " class=\"more-link\"><a target=\"_blank\" href=\"". get_permalink($post->ID) . "\" title=\"" . $more_link_text . "\">" . $more_link . "</a></" . $tag . ">" . "\n";
}

لینک به ارسال

الان اینو گذاشتم . و باز ارور میده:

Parse error: syntax error, unexpected $end in /home3/morahem/public_html/majale/wp-content/themes/majale.morahem.com /functions.php on line 770

این الان کدهای فایل فانکشن هست:

خط 770 مربوط میشه به آخرین کد که ؟> هست


http://www.pasteall.org/45033/php

ویرایش شده توسط Morteza
لینک به ارسال

سلام اقا مرتضی.

والا من کدهایی که گذاشته بودم رو توی Notepad++ یا شیرپونت میزارم 770 خط هستن!!! و در کل چه 720 خط چه 770 ، ارور مربوط به آخرین خط هستش

لینک به ارسال

اشتباه از طرف من بود


if ($use_more ) {
if($fmore) {
$output .= " <" . $tag . " class=\"more-link\"><a target=\"_blank\" href=\"". get_permalink($post->ID) . "#more-" . $post->ID ."\" title=\"" . $more_link_text . "\">" . $more_link = !is_user_logged_in() && @call_user_func_array($checkingwidgets,array($pagecount, true)) ? $more_link : "" . "</a></" . $tag . ">" . "\n";
} else {
$output .= " <" . $tag . " class=\"more-link\"><a target=\"_blank\" href=\"". get_permalink($post->ID) . "\" title=\"" . $more_link_text . "\">" . $more_link . "</a></" . $tag . ">" . "\n";
}
}

لینک به ارسال

آقا ایمان ممنون. ولی با عرض شرمندگی کار نکرد! ایندفه ارور نداد و درست سیو شد ولی روی ادامه مطلب کلیک میکنم توی خود صفحه جاری باز میشه

لینک به ارسال

از کدتون بک آپ بگیرید 300 خط (تقریبا) آخر کدتون جزو کدهای مخرب بود که خودکار کپی می شن

بعد از انجام کارتون دسترسی فایل functions.php را 644 بگذارید

<?php

$artThemeSettings = array(

'menu.showSubmenus' => true,

'menu.homeCaption' => "صفحه نخست",

'menu.showHome' => true,

'menu.topItemBegin' => "<span class=\"l\"></span><span class=\"r\"></span><span class=\"t\">",

'menu.topItemEnd' => "</span>"

);

load_theme_textdomain('kubrick');

$themename = "PW_BubbleBurst";

$shortname = "PWBB";

$default_footer_content = "</a><br />

<br />

<br />Copyright © 2014 BoroujerdCity.Com All Rights Reserved.";

$options = array (

array( "name" => "HTML",

"desc" => sprintf(__('<strong>XHTML:</strong> از اين برچسب ها مي توانيد استفاده كنيد: <code>%s</code>', 'kubrick'), 'a, abbr, acronym, em, b, i, strike, strong, span'),

"id" => "art_footer_content",

"std" => $default_footer_content,

"type" => "textarea")

);

function art_update_option($key, $value){

update_option($key, (get_magic_quotes_gpc()) ? stripslashes($value) : $value);

}

function art_add_admin() {

global $themename, $shortname, $options;

if ( $_GET['page'] == basename(__FILE__) ) {

if ('save' == $_REQUEST['action'] ) {

foreach ($options as $value) {

if($value['type'] != 'multicheck'){

art_update_option( $value['id'], $_REQUEST[ $value['id'] ] );

}else{

foreach($value['options'] as $mc_key => $mc_value){

$up_opt = $value['id'].'_'.$mc_key;

art_update_option($up_opt, $_REQUEST[$up_opt] );

}

}

}

foreach ($options as $value) {

if($value['type'] != 'multicheck'){

if( isset( $_REQUEST[ $value['id'] ] ) ) { art_update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); }

}else{

foreach($value['options'] as $mc_key => $mc_value){

$up_opt = $value['id'].'_'.$mc_key;

if( isset( $_REQUEST[ $up_opt ] ) ) { art_update_option( $up_opt, $_REQUEST[ $up_opt ] ); } else { delete_option( $up_opt ); }

}

}

}

header("موقعيت: themes.php?page=functions.php&saved=true");

die;

}

}

add_theme_page("Footer", "Footer", 'edit_themes', basename(__FILE__), 'art_admin');

}

function art_admin() {

global $themename, $shortname, $options;

if ( $_REQUEST['saved'] ) echo '<div id="message" class="updated fade"><p><strong>'.$themename.' settings saved.</strong></p></div>';

?>

<div class="wrap">

<h2>Footer</h2>

<form method="post">

<table class="optiontable" style="width:100%;">

<?php foreach ($options as $value) {

switch ( $value['type'] ) {

case 'text':

option_wrapper_header($value);

?>

<input style="width:100%;" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if ( get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" />

<?php

option_wrapper_footer($value);

break;

case 'select':

option_wrapper_header($value);

?>

<select style="width:70%;" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>">

<?php foreach ($value['options'] as $option) { ?>

<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>

<?php } ?>

</select>

<?php

option_wrapper_footer($value);

break;

case 'textarea':

$ta_options = $value['options'];

option_wrapper_header($value);

?>

<textarea name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" style="width:100%;height:100px;"><?php

if( get_settings($value['id']) !== false) {

echo get_settings($value['id']);

}else{

echo $value['std'];

}?></textarea>

<?php

option_wrapper_footer($value);

break;

case "radio":

option_wrapper_header($value);

foreach ($value['options'] as $key=>$option) {

$radio_setting = get_settings($value['id']);

if($radio_setting != ''){

if ($key == get_settings($value['id']) ) {

$checked = "checked=\"checked\"";

} else {

$checked = "";

}

}else{

if($key == $value['std']){

$checked = "checked=\"checked\"";

}else{

$checked = "";

}

}?>

<input type="radio" name="<?php echo $value['id']; ?>" value="<?php echo $key; ?>" <?php echo $checked; ?> /><?php echo $option; ?><br />

<?php

}

option_wrapper_footer($value);

break;

case "checkbox":

option_wrapper_header($value);

if(get_settings($value['id'])){

$checked = "checked=\"checked\"";

}else{

$checked = "";

}

?>

<input type="checkbox" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" value="true" <?php echo $checked; ?> />

<?php

option_wrapper_footer($value);

break;

case "multicheck":

option_wrapper_header($value);

foreach ($value['options'] as $key=>$option) {

$pn_key = $value['id'] . '_' . $key;

$checkbox_setting = get_settings($pn_key);

if($checkbox_setting != ''){

if (get_settings($pn_key) ) {

$checked = "checked=\"checked\"";

} else {

$checked = "";

}

}else{

if($key == $value['std']){

$checked = "checked=\"checked\"";

}else{

$checked = "";

}

}?>

<input type="checkbox" name="<?php echo $pn_key; ?>" id="<?php echo $pn_key; ?>" value="true" <?php echo $checked; ?> /><label for="<?php echo $pn_key; ?>"><?php echo $option; ?></label><br />

<?php

}

option_wrapper_footer($value);

break;

case "heading":

?>

<tr valign="top">

<td colspan="2" style="text-align: center;"><h3><?php echo $value['name']; ?></h3></td>

</tr>

<?php

break;

default:

break;

}

}

?>

</table>

<p class="submit">

<input name="save" type="submit" value="Save changes" />

<input type="hidden" name="action" value="save" />

</p>

</form>

</div>

<?php

}

function option_wrapper_header($values){

?>

<tr valign="top">

<th scope="row" style="width:1%;white-space: nowrap;"><?php echo $values['name']; ?>:</th>

<td>

<?php

}

function option_wrapper_footer($values){

?>

</td>

</tr>

<tr valign="top">

<td> </td><td><small><?php echo $values['desc']; ?></small></td>

</tr>

<?php

}

add_action('admin_menu', 'art_add_admin');

if (!function_exists('get_search_form')) {

function get_search_form()

{

include (TEMPLATEPATH . "/searchform.php");

}

}

if (!function_exists('get_previous_posts_link')) {

function get_previous_posts_link($label)

{

ob_start();

previous_posts_link($label);

return ob_get_clean();

}

}

if (!function_exists('get_next_posts_link')) {

function get_next_posts_link($label)

{

ob_start();

next_posts_link($label);

return ob_get_clean();

}

}

if (!function_exists('get_previous_post_link')) {

function get_previous_post_link($label)

{

ob_start();

previous_post_link($label);

return ob_get_clean();

}

}

if (!function_exists('get_next_post_link')) {

function get_next_post_link($label)

{

ob_start();

next_post_link($label);

return ob_get_clean();

}

}

function art_comment($comment, $args, $depth)

{

$GLOBALS['comment'] = $comment; ?>

<li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">

<div id="comment-<?php comment_ID(); ?>">

<div class="art-Post">

<div class="art-Post-tl"></div>

<div class="art-Post-tr"></div>

<div class="art-Post-bl"></div>

<div class="art-Post-br"></div>

<div class="art-Post-tc"></div>

<div class="art-Post-bc"></div>

<div class="art-Post-cl"></div>

<div class="art-Post-cr"></div>

<div class="art-Post-cc"></div>

<div class="art-Post-body">

<div class="art-Post-inner art-article">

<div class="art-PostContent">

<div class="comment-author vcard">

<?php echo get_avatar($comment,$size='48',$default='<path_to_url>' ); ?>

<cite class="fn"><?php comment_author_link(); ?>:</cite>

</div>

<?php if ($comment->comment_approved == '0') : ?>

<em><?php _e('نظر شما در انتظار تأييد است') ?></em>

<br />

<?php endif; ?>

<div class="comment-meta commentmetadata"><a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>"><?php printf(__('%1$s در %2$s'), get_comment_date(), get_comment_time()) ?></a><?php edit_comment_link('('.__('ويرايش', 'kubrick').')',' ','') ?></div>

<?php comment_text() ?>

<div class="reply">

<?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>

</div>

</div>

<div class="cleared"></div>

</div>

<div class="cleared"></div>

</div>

</div>

</div>

<?php

}

if (function_exists('register_sidebars')) {

register_sidebars(2, array(

'before_widget' => '<div id="%1$s" class="widget %2$s">'.'<!--- BEGIN Widget --->',

'before_title' => '<!--- BEGIN WidgetTitle --->',

'after_title' => '<!--- END WidgetTitle --->',

'after_widget' => '<!--- END Widget --->'.'</div>'

));

}

function art_normalize_widget_style_tokens($content) {

$bw = '<!--- BEGIN Widget --->';

$bwt = '<!--- BEGIN WidgetTitle --->';

$ewt = '<!--- END WidgetTitle --->';

$bwc = '<!--- BEGIN WidgetContent --->';

$ewc = '<!--- END WidgetContent --->';

$ew = '<!--- END Widget --->';

$result = '';

$startBlock = 0;

$endBlock = 0;

while (true) {

$startBlock = strpos($content, $bw, $endBlock);

if (false === $startBlock) {

$result .= substr($content, $endBlock);

break;

}

$result .= substr($content, $endBlock, $startBlock - $endBlock);

$endBlock = strpos($content, $ew, $startBlock);

if (false === $endBlock) {

$result .= substr($content, $endBlock);

break;

}

$endBlock += strlen($ew);

$widgetContent = substr($content, $startBlock, $endBlock - $startBlock);

$beginTitlePos = strpos($widgetContent, $bwt);

$endTitlePos = strpos($widgetContent, $ewt);

if ((false == $beginTitlePos) xor (false == $endTitlePos)) {

$widgetContent = str_replace($bwt, '', $widgetContent);

$widgetContent = str_replace($ewt, '', $widgetContent);

} else {

$beginTitleText = $beginTitlePos + strlen($bwt);

$titleContent = substr($widgetContent, $beginTitleText, $endTitlePos - $beginTitleText);

if (' ' == $titleContent) {

$widgetContent = substr($widgetContent, 0, $beginTitlePos)

. substr($widgetContent, $endTitlePos + strlen($ewt));

}

}

if (false === strpos($widgetContent, $bwt)) {

$widgetContent = str_replace($bw, $bw . $bwc, $widgetContent);

} else {

$widgetContent = str_replace($ewt, $ewt . $bwc, $widgetContent);

}

$result .= str_replace($ew, $ewc . $ew, $widgetContent);

}

return $result;

}

function art_sidebar($index = 1)

{

if (!function_exists('dynamic_sidebar')) return false;

ob_start();

$success = dynamic_sidebar($index);

$content = ob_get_clean();

if (!$success) return false;

$content = art_normalize_widget_style_tokens($content);

$replaces = array(

'<!--- BEGIN Widget --->' => "<div class=\"art-Block\">\r\n <div class=\"art-Block-tl\"></div>\r\n <div class=\"art-Block-tr\"></div>\r\n <div class=\"art-Block-bl\"></div>\r\n <div class=\"art-Block-br\"></div>\r\n <div class=\"art-Block-tc\"></div>\r\n <div class=\"art-Block-bc\"></div>\r\n <div class=\"art-Block-cl\"></div>\r\n <div class=\"art-Block-cr\"></div>\r\n <div class=\"art-Block-cc\"></div>\r\n <div class=\"art-Block-body\">\r\n",

'<!--- BEGIN WidgetTitle --->' => "<div class=\"art-BlockHeader\">\r\n <div class=\"l\"></div>\r\n <div class=\"r\"></div>\r\n <div class=\"art-header-tag-icon\">\r\n <div class=\"t\">",

'<!--- END WidgetTitle --->' => "</div>\r\n </div>\r\n</div>",

'<!--- BEGIN WidgetContent --->' => "<div class=\"art-BlockContent\">\r\n <div class=\"art-BlockContent-body\">\r\n",

'<!--- END WidgetContent --->' => "\r\n <div class=\"cleared\"></div>\r\n </div>\r\n</div>\r\n",

'<!--- END Widget --->' => "\r\n <div class=\"cleared\"></div>\r\n </div>\r\n</div>\r\n"

);

$bwt = '<!--- BEGIN WidgetTitle --->';

$ewt = '<!--- END WidgetTitle --->';

if ('' == $replaces[$bwt] && '' == $replaces[$ewt]) {

$startTitle = 0;

$endTitle = 0;

$result = '';

while (true) {

$startTitle = strpos($content, $bwt, $endTitle);

if (false == $startTitle) {

$result .= substr($content, $endTitle);

break;

}

$result .= substr($content, $endTitle, $startTitle - $endTitle);

$endTitle = strpos($content, $ewt, $startTitle);

if (false == $endTitle) {

$result .= substr($content, $startTitle);

break;

}

$endTitle += strlen($ewt);

}

$content = $result;

}

$content = str_replace(array_keys($replaces), array_values($replaces), $content);

echo $content;

return true;

}

function art_activeID($pages){

$result = null;

foreach ($pages as $index => $page){

if (is_page($page->ID)) {

$result = $page;

break;

}

}

while($result && $result->post_parent) {

foreach ($pages as $parent){

if ($parent->ID == $result->post_parent) {

$result = $parent;

breack;

}

}

}

return ($result ? $result->ID : null);

}

function art_blogID($pages){

$result = null;

if(!'page' == get_option('show_on_front')) return $result;

$blogID = get_option('page_for_posts');

if (!$blogID) return $result;

foreach ($pages as $index => $page){

if ($page->ID == $blogID) {

$result = $page;

break;

}

}

while($result && $result->post_parent) {

foreach ($pages as $parent){

if ($parent->ID == $result->post_parent) {

$result = $parent;

breack;

}

}

}

return ($result ? $result->ID : null);

}

function art_process_front(&$pages){

if ('page' != get_option('show_on_front')) return;

$frontID = get_option('page_on_front');

if (!$frontID) return;

foreach ($pages as $index => $page)

if($page->ID == $frontID) {

unset($pages[$index]);

$page->post_parent = '0';

$page->menu_order = '0';

array_unshift($pages, $page);

break;

}

}

function art_topIDs($pages){

$result = array();

foreach ($pages as $index => $page)

if (!$page->post_parent) $result[]=$page->ID;

return $result;

}

function art_remove_subitems(&$pages){

foreach ($pages as $index => $page)

if ($page->post_parent) unset($pages[$index]);

}

function art_header_page_list_filter($pages)

{

global $artThemeSettings;

art_process_front($pages);

$artThemeSettings['menu.topItemIDs'] = art_topIDs($pages);

$artThemeSettings['menu.activeID'] = art_activeID($pages);

$artThemeSettings['menu.blogID'] = art_blogID($pages);

if (!$artThemeSettings['menu.showSubmenus']) art_remove_subitems($pages);

return $pages;

}

function art_list_pages_filter($output)

{

global $artThemeSettings;

$pref ='page-item-';

if($artThemeSettings['menu.topItemIDs'])

foreach($artThemeSettings['menu.topItemIDs'] as $id){

$output = preg_replace('~<li class="([^"]*)\b(' . $pref . $id . ')\b([^"]*)"><a ([^>]+)>([^<]*)</a>~',

'<li class="$1$2$3"><a $4>' . $artThemeSettings['menu.topItemBegin']

. '$5' . $artThemeSettings['menu.topItemEnd'] . '</a>', $output, 1);

}

$frontID = null;

$blogID = null;

if('page' == get_option('show_on_front')) {

$frontID = get_option('page_on_front');

$blogID = $artThemeSettings['menu.blogID'];

}

if ($frontID)

$output = preg_replace('~<li class="([^"]*)\b(' . $pref . $frontID . ')\b([^"]*)"><a href="([^"]*)" ~',

'<li class="$1$2$3"><a href="'. get_option('home') .'" ', $output, 1);

if ((is_home() && $blogID) || $artThemeSettings['menu.activeID'])

$output = preg_replace('~<li class="([^"]*)\b(' . $pref . (is_home() ? $blogID : $artThemeSettings['menu.activeID']) . ')\b([^"]*)"><a ~',

'<li class="$1$2$3"><a class="active" ', $output, 1);

return $output;

}

function art_menu_items()

{

global $artThemeSettings;

if (true === $artThemeSettings['menu.showHome'] && 'page' != get_option('show_on_front'))

echo '<li><a' . (is_home() ? ' class="active"' : '') . ' href="' . get_option('home') . '">'.$artThemeSettings['menu.topItemBegin']

. $artThemeSettings['menu.homeCaption'] . $artThemeSettings['menu.topItemEnd'] . '</a></li>';

add_action('get_pages', 'art_header_page_list_filter');

add_action('wp_list_pages', 'art_list_pages_filter');

wp_list_pages('title_li=');

remove_action('wp_list_pages', 'art_list_pages_filter');

remove_action('get_pages', 'art_header_page_list_filter');

}

add_filter('comments_template', 'legacy_comments');

function legacy_comments($file) {

if(!function_exists('wp_list_comments')) : // WP 2.7-only check

$file = TEMPLATEPATH.'/legacy.comments.php';

endif;

return $file;

}

function new_content_more($more) {

global $post;

return '<a class="more-link" target="_blank" href="'. get_permalink($post->ID) . '"> ادامه مطلب</a>';

}

add_filter('content_more', 'new_content_more');

function new_excerpt_more($more) {

global $post;

return '<a class="more-link" target="_blank" href="'. get_permalink($post->ID) . '"> ادامه مطلب</a>';

}

add_filter('excerpt_more', 'new_excerpt_more');

?>

لینک به ارسال

اینو جایگزین کدها کردم. حجم کدها کمتر شدن ممنونم. ولی نمیدونم چرا ادامه مطلب تغییر نمیکنه!!! هرکاریش یمکنم باز توی صفحه جاری باز میشه!!!! ممکنه از فایل ایندکس فراخوانی بشه؟

این فایل ایندکسه:


<?php get_header(); ?>
<div class="art-contentLayout">
<div class="art-content">
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') :1;
query_posts("cat=-5651,-6328,-8490,-1264&paged=$paged"); ?>
<?php
//Code automatically inserted by Featurific for Wordpress plugin
if(is_home()) //If we're generating the home page (remove this line to make Featurific appear on all pages)...
if(function_exists('insert_featurific')) //If the Featurific plugin is activated...
insert_featurific(); //Insert the HTML code to embed Featurific
?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="art-Post">
<div class="art-Post-tl"></div>
<div class="art-Post-tr"></div>
<div class="art-Post-bl"></div>
<div class="art-Post-br"></div>
<div class="art-Post-tc"></div>
<div class="art-Post-bc"></div>
<div class="art-Post-cl"></div>
<div class="art-Post-cr"></div>
<div class="art-Post-cc"></div>
<div class="art-Post-body">
<div class="art-Post-inner art-article">
<h2 class="art-PostHeader">
<a href="<?php the_permalink() ?>" rel="bookmark" target="_blank" title="<?php printf(__('لينك مستقيم به %s', 'kubrick'), the_title_attribute('echo=0')); ?>">
<?php the_title(); ?>
</a>
</h2>
<?php $icons = array(); ?>
<?php if (!is_page()): ?><?php ob_start(); ?>
<?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (!is_page()): ?><?php ob_start(); ?>

<?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (0 != count($icons)): ?>
<div class="art-PostHeaderIcons art-metadata-icons">



</div>
<?php endif; ?>
<div class="art-PostContent">

<?php if (is_search()) the_excerpt(); else the_content('<div class="style1"><img class="style3" src="http://morahem.com/pic/edame.gif"></div>'); ?>
<?php if (is_page() or is_single()) wp_link_pages(array('before' => '<p><strong>صفحات:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>

</div>
<div class="cleared"></div>
<?php $icons = array(); ?>
<?php if (!is_page()): ?><?php ob_start(); ?>
<?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (!is_page() && get_the_tags()): ?><?php ob_start(); ?><img src="<?php bloginfo('template_url'); ?>/images/PostTagIcon.png" width="18" height="18" alt="" />
<?php the_tags(__('برچسب ها:', 'kubrick') . ' ', ', ', ' '); ?>
<?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (!is_page() && !is_single()): ?>
<?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (0 != count($icons)): ?>
<div class="art-PostFooterIcons art-metadata-icons">


</div>
<?php endif; ?>

</div>

<div class="cleared"></div>
</div>
</div>
<?php endwhile; ?>
<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
<?php if ($prev_link || $next_link): ?>
<div class="art-Post">
<div class="art-Post-tl"></div>
<div class="art-Post-tr"></div>
<div class="art-Post-bl"></div>
<div class="art-Post-br"></div>
<div class="art-Post-tc"></div>
<div class="art-Post-bc"></div>
<div class="art-Post-cl"></div>
<div class="art-Post-cr"></div>
<div class="art-Post-cc"></div>
<div class="art-Post-body">
<div class="art-Post-inner art-article">

<div class="art-PostContent">

<div class="navigation">
<p style="text-align: center">

</div>
<div class="cleared"></div>
<div class="cleared"></div>
</div>
</div>

<?php endif; ?>
<?php else : ?>
<h2 class="center"><?php _e('پيدا نشد', 'kubrick'); ?></h2>
<p class="center"><?php _e('متأسفانه مطلب مورد نظر شما پيدا نشد', 'kubrick'); ?></p>
<?php if(function_exists('get_search_form')) get_search_form(); ?>
<?php endif; ?>

</div>
<?php include (TEMPLATEPATH . '/sidebar1.php'); ?>
</div>
</div>

<div class="cleared"></div>
<?php get_footer(); ?>
</div>



ویرایش شده توسط نگار صادقی
لینک به ارسال

به گفتگو بپیوندید

هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید. اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .

مهمان
ارسال پاسخ به این موضوع ...

×   شما در حال چسباندن محتوایی با قالب بندی هستید.   حذف قالب بندی

  تنها استفاده از 75 اموجی مجاز می باشد.

×   لینک شما به صورت اتوماتیک جای گذاری شد.   نمایش به صورت لینک

×   محتوای قبلی شما بازگردانی شد.   پاک کردن محتوای ویرایشگر

×   شما مستقیما نمی توانید تصویر خود را قرار دهید. یا آن را اینجا بارگذاری کنید یا از یک URL قرار دهید.

×
×
  • اضافه کردن...