• Hi

    I want to change the layout and look of the category page from

    category page

    to something similar layout to

    recipe

    where do I have to add code to my child theme so that it will display it as i want.

    I also want to be able to show the sub-categories in a given category

    thanks in advance and kind regards

    Phillip Moringer

    Always cooking
    Immer beim Kochen
    Sempre a cozinhar

    • This topic was modified 3 years, 6 months ago by chefwildboar.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @chefwildboar,

    From what I can see, the /our-recipes/ page is listing out the recipes using the Recipe plugin’s functionality. Therefore, in order to achieve the same look on the categories page, a lot of custom coding would be necessary, editing the entire archive template (archive.php). You can try editing it with some custom CSS, though, but you won’t be able to add all the information that the plugin is displaying.

    Regarding displaying the subcategories, I’m afraid there is no out-of-the-box solution for this, either.

    Thread Starter chefwildboar

    (@chefwildboar)

    HI @gdalex

    Yes, i know that coding is a must for what i want, i have already created a category.php file and edit. (i am a little rusty have not coded in 10 years)

    A about the subcategories i have been able to list all categories but some how i am unable to get the string for all child categories id correctly so that i can set it in the shortcode i use to display the categories

    rezept category

    always cooking
    immer beim kochen
    sempre a cozinhar

    Phillip Moringer

    PS : this is the code i have ate the moment

    <div class="wprm-spacer"></div>
    <?php
    /**
    * A Simple Category Template
    */
     
    get_header(); ?>
    <div class="wprm-spacer">
    
    </div>
    <br>
    <p>
    <?php 
    	$categories = get_the_category();
    $category_id = $categories[0]->cat_ID;
    	$childid = array('child_of'=> 244);
    	$childid_cat = get_categories( $childid );
    		foreach($childid_cat as $category) {
    		//echo '<p> is child id ' $category->term_id'</p>'; 
    		echo 'abc' ;
    		echo '<p>Category: <a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a> </p> ';
        echo '<p> Description:'. $category->description . '</p>';
        echo '<p> Post Count: '. $category->count . '</p>';  
    }
    	wp_list_categories( array(
            'orderby'            => 'id',
            'show_count'         => true,
            'use_desc_for_title' => false,
            'child_of'           => $category_id
        ) ); ?>
    	<?php echo do_shortcode('[pci-cat-slider size="thumbnail" show_desc="false" dots="true" arrows="false" autoplay="true" term_id= $childid]'); ?>
    	<?php Go\page_title();	?>
    </p>
    
    <div class="wprm-spacer"></div> 
    <section id="primary" class="site-content">
    <div id="content" role="main" style>
     
    	<?php 
    	// Check if there are any posts to display
    	if ( have_posts() ) : ?> 
    	<?php
    	// Display optional category description
    	 if ( category_description() ) : ?>
    	<div class="wprm-spacer"> </div>
    		<h3 style="text-align: center;">
    			Category discription: 
    		</h3>
    	
    	<div class="archive-meta"style="padding: 5px 60px;"><?php echo category_description(); ?></div>
    	<?php endif; ?>
    
     
    	<?php
     
    	// The Loop
    	while ( have_posts() ) : the_post();?> 
    		<div  style="padding: 25px 50px;">
    			<div style="border: 1px solid black; border-radius: 7px;background-color:#f4e8ea;padding:15px ;">
    				<div  class="wprm-recipe-roundup-summary-container">
    					<div  >
    						<div  >
    							<div class="post__thumbnail1" style="width: 225px; height:225px;padding: 5px!important;">
    							<?php ;the_post_thumbnail(); ?>
    							</div>
    
    						<?php get_template_part( 'partials/content', 'excerpt' );?>	
    						</div>
    						
    					</div>
    				</div>
    			</div>
    		</div>
    	
    	
    	<?php 
    	// Previous/next page navigation.
    	get_template_part( 'partials/pagination' );?>
    
     
    		<div class="entry">
    
     
     		<p class="postmetadata"><?php
      		//comments_popup_link( 'No comments yet', '1 comment', '% comments', 'comments-link', 'Comments closed');
    		?></p>
    		</div>
     
    	<?php endwhile; 
     
    	else: ?>
    	<p>Sorry, no posts matched your criteria.</p>
     
     
    	<?php endif; ?>
    
     
     
    	<?php get_footer(); ?>
    	</div>
    	
    </section>
    • This reply was modified 3 years, 6 months ago by chefwildboar.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘where do i have to do changes to category page layout’ is closed to new replies.