WordPress.org

Ready to get started?Download WordPress

Forums

PHP help: How To Show Featured Image on Category Page (10 posts)

  1. ghettogandy
    Member
    Posted 1 year ago #

    I've searched thoroughly and seen this issue covered in several ways that didn't seem to apply to my configuration. So thanks in advance for any time and help.

    Here's my site: http://www.playrockreggae.com/

    The Home page (which is showing latest posts) shows each post's Featured Image(post thumbnail) plus the post excerpt. I'd like to know how and where to change the PHP to make the other main menu items (Video Premiere, Music Premiere, etc -- which are all Categories) show just like the Home page. As of now, only the Home page shows the Featured Images alongside the post excerpt, while all other pages only display the post title and excerpt.

    My theme is Pagelines WhiteHouse Pro v3.0.1 using WP v3.4.2. Other solutions refer to a loop.php file, which doesn't seem to exist in my theme. Seems easy enough but I'm just not familiar with PHP.

    Thanks guys,
    -AG

  2. Jay Hoffmann
    Member
    Posted 1 year ago #

    What you should be looking for is your category.php file. This is the file that WordPress uses for any category pages. You can just edit this file to mirror the index.php file.

    http://codex.wordpress.org/Category_Templates

    And since you are on a theme that will most likely be updated (thereby erasing the edits you made) you should do this by first creating a child theme for it.

    http://codex.wordpress.org/Child_Themes

  3. ghettogandy
    Member
    Posted 1 year ago #

    I'm not finding a category.php file anywhere.

    Here's the entirety of my index.php file:

    <?php 
    
     	get_header();
    	get_template_part('library/template_posts');
    	get_footer(); 
    
    ?>

    And so, would this template_posts.php file be the culprit?

    Here's the entirety of that template_posts.php file:

    <?php
    
    	global $pagelines_ID; 
    
    	if(is_page_template('page-fullwidth.php') || is_page_template('page-fullhighlight.php') || is_page_template('page-carousel-full')) $full_width_page = true;
    	else $full_width_page = false;
    
    	if(is_page_template('page-carousel.php') || is_page_template('page-carousel-full.php')) $carousel_page = true;
    	else $carousel_page = false;
    
    	if(VPRO && (is_page_template('page-feature.php') || is_page_template('page-feature-page.php') || (is_home() && pagelines('featureblog')))) $featureslide_template = true;
    	else $featureslide_template = false;
    
    	if(VPRO && (is_page_template('page-feature.php') || m_pagelines('featureboxes', $pagelines_ID))) $fboxes_template = true;
    	else $fboxes_template = false;
    
    ?>
    
    <?php if($featureslide_template) get_template_part('pro/template_feature'); ?>
    <?php if($carousel_page) get_template_part('pro/template_carousel');?>
    <div id="contentcontainer" class="content fix">
    	<div id="contentborder">
    
    		<?php if(!is_page_template('page-highlight.php') && !is_404()) get_template_part('library/_sub_head');?>
    
    		<?php if(is_page_template('page-fullhighlight.php')) get_template_part ('pro/template_highlight'); ?>
    
    		<?php if($fboxes_template) get_template_part('pro/template_fboxes');?>
    
    			<div id="maincontent" <?php if($full_width_page):?>class="fullwidth"<?php endif;?> >
    				<?php if(is_page_template('page-highlight.php')):?>
    					<?php get_template_part('pro/template_highlight');?>
    					<?php get_template_part('library/_sub_head');?>
    					<?php the_post_thumbnail();?>
    				<?php endif;?>
    
    				<?php get_template_part ('library/_posts'); ?>
    			</div>
    
    			<?php if(!$full_width_page) get_sidebar();?>
    
    		<?php get_template_part ('library/_contentfooter'); ?>
    		<div class="clear"></div>
    	</div>
    </div>

    Thanks,
    -AG

  4. Jay Hoffmann
    Member
    Posted 1 year ago #

    Could be, but the category should default to the index.php file (your home page) if you don't have a category page. I would contact the theme developer directly to find out how to edit category pages, there is most likely a way of doing it without breaking the code all that much.

  5. ghettogandy
    Member
    Posted 1 year ago #

    Thanks again. I believe Pagelines has discontinued their theme development and support in lieu of a switch to developing custom framework.

    So possibly another user here might be familiar with this code in particular and offer a quick pointer.

    -AG

  6. Andrew Bartel
    Member
    Posted 1 year ago #

    Is there an archive.php?

  7. ghettogandy
    Member
    Posted 1 year ago #

    Hey Andrew, no, there isn't an archive.php to be found.

    And to anyone that might review the above template_posts.php code, one small but significant correction:

    That one instance it's showing of <?php the_post_thumbnail();?> is from my fooling around and shouldn't be there. So consider that non-existent.

    -AG

  8. Andrew Bartel
    Member
    Posted 1 year ago #

    What all is in the library directory?

  9. ghettogandy
    Member
    Posted 1 year ago #

    Andrew, the contents of the library folder:
    _authorinfo, _commentsform, _contentfooter, _contentsidebar, _customcss, _defaultsidebar, _flickr, _font_replacement, _footer_nav, _grandchildnav_pro, _ie_fixes, _morefoot, _pagination, _picker, _post_footer, _postnav, _posts, _searchform, _sub_head, _sub_nav, _twittermessages, dynamic_css, template_posts, widget_welcome

    -AG

  10. marcprince
    Member
    Posted 10 months ago #

Topic Closed

This topic has been closed to new replies.

About this Topic