رفتن به مطلب

یک مشکل کوچک با یک قالب رایگان


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

با سلام

دوستان من یک قالب رایگان دارم که خیلی خوب هست منتها برچسب نداره .

لینک دانلود :

Theme-Tafrihi-[Web-Master]

میخواستم خودم اضافش کنم که کد مربوطه رو گذاشتم ولی ارور میده . اومدم اون کد برچسبها را آخرین خط گذاشتم که اونم خارج از کادر پست دراومد و شکل خوبی به خودش نگرفت :

کد 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'),

 winksmiley02.gif

);

بذارم که ارور میده .

لطفا کمکم کنید .

خیلی خیلی ازتون ممنون .

لینک به ارسال

برای قرار دادن کد در انجمن از کلید <> در ویرایشگر استفاده کنید

تگ رو به کجا میخواهید اضافه کنید؟ صفحه اصلی؟ پست؟

کد index, single را قرار دهید

لینک به ارسال

این رو تست کنید


<?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('tag', 'footer'),
)
);
?>

لینک به ارسال

تگ رو به کجا میخواهید اضافه کنید؟ صفحه اصلی؟ پست؟

کد index, single را قرار دهید

لینک به ارسال

کد 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()
)
);
?>

لینک به ارسال

دوست عزیز همون کد اولی که بهتون دادم درست بود توی خط 337 فایل functions.php تون هم تعریف شده

شما موقع ارسال پست برچسب ها را درست انتخاب می کنید؟

اگر از درستی انتخاب برچسب مطمئنید کد اولی که عرض کردم را بگذارید و نشانی آنلاین بدید

لینک به ارسال

من کجا را امتحان کنم؟

برای مطلبتون برچسب انتخاب کنید

در پیشخوان

نوشته ها

همه نوشته ها

از گوشه سمت چپ بالای سایت روی تنظیمات بزنید و گزینه برچسب ها را تیکدار کنید از صفحه یک اسکرین تهیه کنید که مطلبی که برچسب دارد را مشخص کرده باشد و همراه با نشانی پیوند یکتای همون مطلب بگذارید اینجا

لینک به ارسال

من کجا را امتحان کنم؟

برای مطلبتون برچسب انتخاب کنید

در پیشخوان

نوشته ها

همه نوشته ها

از گوشه سمت چپ بالای سایت روی تنظیمات بزنید و گزینه برچسب ها را تیکدار کنید از صفحه یک اسکرین تهیه کنید که مطلبی که برچسب دارد را مشخص کرده باشد و همراه با نشانی پیوند یکتای همون مطلب بگذارید اینجا

دوست عزیز من فرق بودن یا نبودن برچسب رو میدونم مطالبی که برچسب داره رو نشون نمیده وگرنه من خودم میدونم اگه برچسب نداشته باشه نشون نمیده . مشکل اینجاست که برچسبها را کلا نشون نمیده .

لینک به ارسال

این رو در functions قرار دهید


function wpp_drop_tags()
{
foreach (get_the_tags() as $tag)
{
$out .= '<a href="'.get_tag_link($tag->term_id).'">' . $tag->name . '</a> , ';
}
$out = rtrim($out," , ");

return $out;
}

و تست


<?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').'<br>'.wpp_drop_tags(),
'comments' => theme_get_comments()
)
);
?>

لینک به ارسال

دوست عزیز من فرق بودن یا نبودن برچسب رو میدونم مطالبی که برچسب داره رو نشون نمیده وگرنه من خودم میدونم اگه برچسب نداشته باشه نشون نمیده . مشکل اینجاست که برچسبها را کلا نشون نمیده .

من عرض نکردم شما چیزی را می دونید یا خیر

ایراد از کدهای php نیست و الا با کد پارسای گرامی حل می شد

مشکل می تونه از استایل دهی یا افزونه های سئو باشه

اگر خودتون می دونید که هیچ مشکل رو حل کنید و الا کاری که عرض شد را انجام دهید تا ادامه دهیم

لینک به ارسال

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

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

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

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

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

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

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

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

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