1

我尝试了一切以使其正常工作,但我无法修复它!

在此页面上http://bit.ly/195ooX2

我有我的投资组合项目,但我想在图片下方显示项目的名称。它不必是可点击的,但我只是希望它显示名称。我理解他们需要为它留出空间。但我只是想知道我需要将什么样的代码放在哪里?

它需要是这样的: http: //bit.ly/18aVx45

这是我认为需要完成的代码:

<div id="content-area" class="fullwidth clearfix">
<div class="post-content">
    <?php while ( have_posts() ) : the_post(); ?>
        <?php the_content(); ?>
        <?php wp_link_pages(array('before' => '<p><strong>'.esc_attr__('Pages','Flexible').':</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
        <?php edit_post_link(esc_attr__('Edit this page','Flexible')); ?>
    <?php endwhile; ?>
</div>  <!-- end .post-content -->
<?php
    $et_ptemplate_settings = array();
    $et_ptemplate_settings = get_post_meta($post->ID,'et_ptemplate_settings',true);
    $et_ptemplate_projectcats = isset( $et_ptemplate_settings['et_ptemplate_projectcats'] ) ? (array) $et_ptemplate_settings['et_ptemplate_projectcats'] : array();

    $portfolio_args = array(
        'post_type' => 'project',
        'showposts' => -1,
        'tax_query' => array(
            array(
                'taxonomy' => 'project_category',
                'field' => 'id',
                'terms' => $et_ptemplate_projectcats,
                'operator' => 'IN'
            )
        )
    );
    if ( empty( $et_ptemplate_projectcats ) )  unset ( $portfolio_args['tax_query'] );

    $portfolio_query = new WP_Query( apply_filters( 'et_home_portfolio_args', $portfolio_args ) );

    $categories = get_terms( 'project_category', array( 'include' => $et_ptemplate_projectcats ) );
    if ( $categories ){
        echo '<ul id="et_portfolio_sort_links">';
            echo '<li class="active">' . '<a href="#" data-categories_id="all">' . __( 'All', 'Flexible' ) . '</a>' . '</li>';
            foreach ( $categories as $category ){
                echo '<li>' . '<a href="#" data-categories_id="' . esc_attr( 'project_cat_' . $category->term_taxonomy_id ) . '">' . esc_html( $category->name ) . '</a>' . '</li>';
            }
        echo '</ul>';
    }
?>
<div id="portfolio-grid" class="clearfix">

<?php
        while ( $portfolio_query->have_posts() ) : $portfolio_query->the_post(); 
                    get_template_part( 'includes/entry', 'portfolio' );
            endwhile; 
    wp_reset_postdata(); ?>

</div> <!-- end #portfolio-grid -->

4

1 回答 1

0

您需要编辑以下(模板)文件之一:

wp-content/themes/{template}/includes/entry-portfolio.php

或者

wp-content/themes/{template}/includes/entry.php

在该文件中,您将以下行放在图像下方:

 <?php echo get_the_title(); ?> 
于 2013-06-07T13:58:46.937 回答