رفتن به مطلب

نمایش دسته در برگه ی نوشته های برگه یکتا


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

سلام

من برای صفحه اول یک برگه یکتا ایجاد کردم و تم هم قابلیت نمایش دسته ها در حالت روزنامه ای رو داره. اما وقتی دسته ها رو نمایش میده با تیتر تفکیک نمیکنه این پست ها برای چه دسته ای هست.

امکانش هست این نمایش دسته ای رو براش ایجاد کرد؟

دموش اینه:

http://demo.graphene-theme.com/

لینک به ارسال

دموی چی اینه؟

اگر فایل category.php در پوشه قالب دارید اگر نبود archive.php و اگر نبود index.php را باز کنید و در محل مناسب وارد کنید:


<?php /* If this is a category archive */ if (is_category()) { ?>
<h2 class="pagetitle"><?php printf('کل مطالب دسته بندی شده در %s ', single_cat_title('', false)); ?></h2>
<?php }?>

لینک به ارسال

ممنون. ولی جواب نداد :(

تو هر سه فایل جاهای مختلف تست کردم اما تغییر حاصل نشد.

این دموی قالب ـمه، چون تو همین حالت استاتیک بود گذاشتم تا متوجه صحبتم بشید. {قسمت پایین پیج دمو، پست ها رو تو دو ستون نمایش داده.}

این سه فایل

category,

archive,

index :

<?php

/**

* The category archive template file

*

* @package Graphene

* @since Graphene 1.1.5

*/

get_header();

?>

<h1 class="page-title archive-title">

<?php

printf( __( 'Category Archive: <span>%s</span>', 'graphene' ), single_cat_title( '', false ) );

?>

</h1>

<?php graphene_tax_description(); ?>

<div class="entries-wrapper">

<?php

/**

* Run the loop for the category page to output the posts.

* If you want to overload this in a child theme then include a file

* called loop-category.php and that will be used instead.

*/

while ( have_posts() ) {

the_post();

get_template_part( 'loop', 'category' );

}

?>

</div>

<?php graphene_posts_nav(); ?>

<?php get_footer(); ?>

<?php

/**

* The archive template file

*

* @package Graphene

* @since Graphene 1.1.5

*/

get_header();

?>

<?php

/* Queue the first post, that way we know

* what date we're dealing with (if that is the case).

*

* We reset this later so we can run the loop

* properly with a call to rewind_posts().

*/

if ( have_posts() )

the_post();

?>

<h1 class="page-title archive-title">

<?php if ( is_day() ) : ?>

<?php printf( __( 'Daily Archive: %s', 'graphene' ), '<span>' . get_the_date() . '</span>' ); ?>

<?php elseif ( is_month() ) : ?>

<?php printf( __( 'Monthly Archive: %s', 'graphene' ),

/* translators: F will be replaced with month, and Y will be replaced with year, so "F Y" in English would be replaced with something like "June 2008". */

'<span>' . get_the_date( __( 'F Y', 'graphene' ) ) . '</span>' ); ?>

<?php elseif ( is_year() ) : ?>

<?php printf(__( 'Yearly Archive: %s', 'graphene' ), '<span>' . get_the_date( 'Y' ) . '</span>' ); ?>

<?php else : ?>

<?php _e( 'Blog Archive', 'graphene' ); ?>

<?php endif; ?>

</h1>

<div class="entries-wrapper">

<?php

/* Since we called the_post() above, we need to

* rewind the loop back to the beginning that way

* we can run the loop properly, in full.

*/

rewind_posts();

/* Run the loop for the archives page to output the posts.

* If you want to overload this in a child theme then include a file

* called loop-archives.php and that will be used instead.

*/

while ( have_posts() ) {

the_post();

get_template_part( 'loop', 'archive' );

}

?>

</div>

<?php graphene_posts_nav(); ?>

<?php get_footer(); ?>

<?php

/**

* The main template file.

*

* This is the most generic template file in a WordPress theme

* and one of the two required files for a theme (the other being style.css).

* It is used to display a page when nothing more specific matches a query.

* E.g., it puts together the home page when no home.php file exists.

* Learn more: http://codex.wordpress.org/Template_Hierarchy

*

* @package Graphene

* @since Graphene 1.0

*/

global $graphene_settings;

get_header(); ?>

<div class="entries-wrapper">

<?php

do_action('graphene_index_pre_loop');

/* Run the loop to output the posts.

* If you want to overload this in a child theme then include a file

* called loop-index.php and that will be used instead.

*/

while ( have_posts() ) {

the_post();

get_template_part( 'loop', 'index' );

}

?>

</div>

<?php ?>

<span lang="fa" dir="rtl">

<?php get_template_part('navigation'); ?>

</span>

<?php get_footer(); ?>

لینک به ارسال

راستی الان چون برگه استاتیک ـه نباید تو قسمت theme-panes.php قالب ـم پیگیری کنم؟

<?php

/**

* Adds the content panes in the homepage. The homepage panes are only displayed if using a static

* front page, before the comments. It is also recommended that the comments section is disabled

* for the page used as the static front page.

*/

function graphene_homepage_panes(){

global $graphene_settings, $graphene_defaults, $in_homepage_panes;

$in_homepage_panes = true;

// Get the number of panes to display

if ( $graphene_settings['show_post_type'] == 'latest-posts' || $graphene_settings['show_post_type'] == 'cat-latest-posts' ){

$pane_count = $graphene_settings['homepage_panes_count'];

} elseif ( $graphene_settings['show_post_type'] == 'posts' ) {

$pane_count = count(explode( ',', $graphene_settings['homepage_panes_posts']) );

}

// Build the common WP_Query() parameter first

$args = array(

'orderby' => 'date',

'order' => 'DESC',

'post_type' => array( 'post', 'page' ),

'posts_per_page' => $pane_count,

'ignore_sticky_posts' => 1,

);

// args specific to latest posts

if ( $graphene_settings['show_post_type'] == 'latest-posts' ){

$args_merge = array(

'post_type' => array( 'post' ),

);

$args = array_merge( $args, $args_merge );

}

// args specific to latest posts by category

if ( $graphene_settings['show_post_type'] == 'cat-latest-posts' ){

$args_merge = array(

'category__in' => graphene_object_id( $graphene_settings['homepage_panes_cat'], 'category' ),

);

$args = array_merge( $args, $args_merge );

}

// args specific to posts/pages

if ( $graphene_settings['show_post_type'] == 'posts' ){

$post_ids = $graphene_settings['homepage_panes_posts'];

$post_ids = preg_split("/[\s]*[,][\s]*/", $post_ids, -1, PREG_SPLIT_NO_EMPTY); // post_ids are comma seperated, the query needs a array

$post_ids = graphene_object_id( $post_ids );

$args_merge = array(

'post__in' => $post_ids,

'orderby' => 'post__in'

);

$args = array_merge( $args, $args_merge );

}

// Get the posts to display as homepage panes

$panes = new WP_Query( apply_filters( 'graphene_homepage_panes_args', $args ) );

$count = 0;

?>

<?php do_action( 'graphene_before_homepage_panes' ); ?>

<div class="homepage_panes">

<?php while ( $panes->have_posts() ) : $panes->the_post();

$count++;

$alpha = $omega = false;

if ( $count % 2 ){

$alpha = true;

} else {

$omega = true;

}

?>

<div <?php graphene_grid( 'homepage_pane clearfix', 8, 5, 4, $alpha, $omega ); ?> id="homepage-pane-<?php the_ID(); ?>">

<?php do_action( 'graphene_homepage_pane_top' ); ?>

<a href="<?php the_permalink(); ?>" title="<?php printf( __( 'Permalink to %s', 'graphene' ), esc_attr( get_the_title() ) ); ?>">

<?php /* Get the post's image */

if ( has_post_thumbnail( get_the_ID() ) ) {

the_post_thumbnail( 'graphene-homepage-pane' );

} else {

echo graphene_get_post_image( get_the_ID(), 'graphene-homepage-pane', 'excerpt' );

}

?>

</a>

<?php /* The post title */ ?>

<h3 class="post-title">

<a href="<?php the_permalink(); ?>" title="<?php printf( __( 'Permalink to %s', 'graphene' ), esc_attr( get_the_title() ) ); ?>"><?php the_title(); ?></a>

<?php do_action( 'homepage_pane_title' ); ?>

</h3>

<?php /* The post excerpt */ ?>

<div class="post-excerpt">

<?php

the_excerpt();

do_action( 'graphene_homepage_pane_content' );

?>

</div>

<?php /* Read more button */ ?>

<p class="post-comments">

<a href="<?php the_permalink(); ?>" title="<?php printf( __( 'Permalink to %s', 'graphene' ), esc_attr( get_the_title() ) ); ?>" class="block-button"><?php _e( 'Read more', 'graphene' ); ?></a>

</p>

<?php do_action( 'graphene_homepage_pane_bottom' ); ?>

</div>

<?php endwhile; wp_reset_postdata(); ?>

</div>

<?php

do_action( 'graphene_after_homepage_panes' );

unset( $in_homepage_panes );

}

/* Helper function to control when the homepage panes should be displayed. */

function graphene_display_homepage_panes(){

global $graphene_settings;

if ( get_option( 'show_on_front' ) == 'page' && ! $graphene_settings['disable_homepage_panes'] && is_front_page() ) {

graphene_homepage_panes();

}

}

add_action( 'graphene_bottom_content', 'graphene_display_homepage_panes' );

?>

لینک به ارسال

این صفحه با تابع


if ( $graphene_settings['show_post_type'] == 'cat-latest-posts' ){
$args_merge = array(
'category__in' => graphene_object_id( $graphene_settings['homepage_panes_cat'], 'category' ),
);
$args = array_merge( $args, $args_merge );

}

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

لینک به ارسال

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

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

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

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

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

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

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

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

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