mikhak
-
تعداد ارسالها
119 -
تاریخ عضویت
-
آخرین بازدید
نوشتهها ارسال شده توسط mikhak
-
-
مشکلی هست اونم اینکه فقط در ادامه مطالب کار میکنه نه در صفحه اول سایت و موندم چرا اینطوری کار نمیکنه مگه نباید فایل فانکشن روی ایندکس هم تاثیر بگذاره ؟
-
هیچی اضافه نمیشه میتونید خودتون هم یه امتحانی بکنید
-
بله حق با شما بود در جای مناسبی قرار دادم و کار کرد منتها مشکلی هست اونم اینکه فقط در ادامه مطالب کار میکنه نه در صفحه اول سایت و موندم چرا اینطوری کار نمیکنه مگه نباید فایل فانکشن روی ایندکس هم تاثیر بگذاره ؟
-
فایل فانکشن :
http://www.pasteall.org/47391 -
میشه شما برام در جای مناسب قرار داده و تست کرده بهم بدید ؟ من هر جایی میذارم ارور میده ؟ لطفا
-
کد index
<?php get_header(); ?>
<?php get_sidebar('top'); ?>
<?php
if (have_posts()) {
/* Display navigation to next/previous pages when applicable */
if (theme_get_option('theme_' . (theme_is_home() ? 'home_' : '') . 'top_posts_navigation')) {
theme_page_navigation();
}
/* Start the Loop */
while (have_posts()) {
the_post();
get_template_part('content', get_post_format());
}
/* Display navigation to next/previous pages when applicable */
if (theme_get_option('theme_bottom_posts_navigation')) {
theme_page_navigation();
}
} else {
theme_404_content();
}
?>
<?php get_sidebar('bottom'); ?>
<?php get_footer(); ?>کد single:
<?php
/**
*
* single.php
*
* The single post template. Used when a single post is queried.
*
*/
get_header();
?>
<?php get_sidebar('top'); ?>
<?php
if (have_posts()) {
/* Display navigation to next/previous posts when applicable */
if (theme_get_option('theme_top_single_navigation')) {
theme_post_navigation(
array(
'prev_link' => theme_get_previous_post_link('« %link'),
'next_link' => theme_get_next_post_link('%link »')
)
);
}
while (have_posts()) {
the_post();
get_template_part('content', 'single');
}
/* Display navigation to next/previous posts when applicable */
if (theme_get_option('theme_bottom_single_navigation')) {
theme_post_navigation(
array(
'prev_link' => theme_get_previous_post_link('« %link'),
'next_link' => theme_get_next_post_link('%link »')
)
);
}
} else {
theme_404_content();
}
?>
<?php get_sidebar('bottom'); ?>
<?php get_footer(); ?>کد conten-single.php
<?php
/**
*
* content*.php
*
* The post format template. You can change the structure of your posts or add/remove post elements here.
*
* 'id' - post id
* 'class' - post class
* 'thumbnail' - post icon
* 'title' - post title
* 'before' - post header metadata
* 'content' - post content
* 'after' - post footer metadata
*
* To create a new custom post format template you must create a file "content-YourTemplateName.php"
* Then copy the contents of the existing content.php into your file and edit it the way you want.
*
* Change an existing get_template_part() function as follows:
* get_template_part('content', 'YourTemplateName');
*
*/
global $post;
theme_post_wrapper(
array(
'id' => theme_get_post_id(),
'class' => theme_get_post_class(),
'title' => theme_get_meta_option($post->ID, 'theme_show_post_title') ? get_the_title() : '',
'heading' => theme_get_option('theme_single_article_title_tag'),
'before' => theme_get_metadata_icons('date,author,edit', 'header'),
'content' => theme_get_content(),
'after' => theme_get_metadata_icons('', 'footer'),
'comments' => theme_get_comments()
)
);
?> -
داخل فایل content-shingle.php
-
وقتی این کد را در فایل فانکشن میذارم کل قالب از کار می افته
-
با سلام
دوست عزیز چرا وقتی کد زیر رو در قالبتون ( فایل فانکشن ) میذارم خطا میده ؟
/** Auto-Generate ALT tag for images */
function image_alt_tag($content)
{global $post;preg_match_all('/<img (.*?)\/>/', $content, $images);
if(!is_null($images)) {foreach($images[1] as $index => $value)
{if(!preg_match('/alt=/', $value)){
$new_img = str_replace('<img', '<img alt="'.get_the_title().'"', $images[0][$index]);
$content = str_replace($images[0][$index], $new_img, $content);}}}
return $content;
}
add_filter('the_content', 'image_alt_tag', 99999); -
ممنون ازتون ولی دوست عزیز برچسبی ظاهر نشد تغییرات جوابگو نبود
-
در فایل conten-single.php
-
با سلام
دوستان من یک قالب رایگان دارم که خیلی خوب هست منتها برچسب نداره .
لینک دانلود :
میخواستم خودم اضافش کنم که کد مربوطه رو گذاشتم ولی ارور میده . اومدم اون کد برچسبها را آخرین خط گذاشتم که اونم خارج از کادر پست دراومد و شکل خوبی به خودش نگرفت :
کد HTML:
<?php
/**
*
* content*.php
*
* The post format template. You can change the structure of your posts or add/remove post elements here.
*
* 'id' - post id
* 'class' - post class
* 'thumbnail' - post icon
* 'title' - post title
* 'before' - post header metadata
* 'content' - post content
* 'after' - post footer metadata
*
* To create a new custom post format template you must create a file "content-YourTemplateName.php"
* Then copy the contents of the existing content.php into your file and edit it the way you want.
*
* Change an existing get_template_part() function as follows:
* get_template_part('content', 'YourTemplateName');
*
*/
global $post;
theme_post_wrapper(
array(
'id' => theme_get_post_id(),
'class' => theme_get_post_class(),
'title' => theme_get_meta_option($post->ID, 'theme_show_post_title') ? get_the_title() : '',
'heading' => theme_get_option('theme_single_article_title_tag'),
'before' => theme_get_metadata_icons('date,author,edit', 'header'),
'content' => theme_get_content(),
'after' => theme_get_metadata_icons('', 'footer'),
)
);
?>
<?php the_tags('برچسب ها: ', ', ', '<br />'); ?>
منتها برای اینکه داخل پست بیاد باید این
<?php the_tags('برچسب ها: ', ', ', '<br />'); ?>
قبل از
'after' => theme_get_metadata_icons('', 'footer'),
);
بذارم که ارور میده .
لطفا کمکم کنید .
خیلی خیلی ازتون ممنون .
-
من افزونه ای رو میخوام که با هاش کاربرام عضو بشن و هر عضو که از سایت بیشتر بازدید کنه رو به عنوان کاربر برتر نمایش بده.
-
با سلام من دنبال یک افزونه هستم که برترین اعضای سایت رو با توجه به میزان بازدیدهاشون برام نشون بده ."
همچنین چه افزونه ای برای عضو گیری مناسبه ؟
با تشکر
یک مشکل کوچک با یک قالب رایگان
در مشکلات دیگر
ارسال شده در
دوست عزیز من فرق بودن یا نبودن برچسب رو میدونم مطالبی که برچسب داره رو نشون نمیده وگرنه من خودم میدونم اگه برچسب نداشته باشه نشون نمیده . مشکل اینجاست که برچسبها را کلا نشون نمیده .