• Resolved Freelancealot

    (@freelancealot)


    Hi,

    I’ve just spent the last five hours trying to get a simple change done to display a CPT archive in an OceanWP child theme. ??

    I have managed to display the CPT custom fields in single posts, but I need to display some custom fields rather than the excerpt in the grid archive layout. It should be simple.

    I have my child theme, I have duplicated OceanWP index.php and put in child theme folder.

    I have copied partials/entry into a folder for the CPT (my_event) in the child theme folder, so it is now child theme / partials / my-event / entry / …

    I have changed the path in the child theme / partials / my-event / entry / layout.php file.

    In the index.php I have

    
    <?php
    // Check if posts exist.
    if ( have_posts() ) :
    					
    if ( is_post_type_archive( 'my-event' )) {
    ?>
    <div id="blog-entries" class="<?php oceanwp_blog_wrap_classes(); ?>">
    
    <?php
    // Define counter for clearing floats.
    $oceanwp_count = 0;
    ?>
    <?php
    // Loop through posts.
    while ( have_posts() ) :
    the_post();
    ?>
    
    <?php
    // Add to counter.
    $oceanwp_count++;
    ?>
    
    <?php
    // Get post entry content.
    get_template_part( 'partials/my-event/entry/layout', get_post_type() );
    ?>
    
    <?php
    // Reset counter to clear floats.
    if ( oceanwp_blog_entry_columns() === $oceanwp_count ) {
    $oceanwp_count = 0;
    }
    ?>
    <?php endwhile; ?>
    </div><!-- CPT-entries -->
    

    It is not picking up any changes I make to the partials in the my-event / entry / layout.php

    As a simple test, I’ve changed the Continue Reading to More Info on the readmore.php file, and it’s not changing. It’s still displaying the Oceanwp readmore.php text.

    I’m just about to give up. Any help appreciated.

    Cheers,
    Tracy

    • This topic was modified 4 years, 4 months ago by Freelancealot.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Child Theme partials not being recognised’ is closed to new replies.