Forum Replies Created

Viewing 5 replies - 16 through 20 (of 20 total)
  • Thread Starter Astilla VGR

    (@astilla222)

    Thanks a lot for your help @joyously.

    Why I try to create a content-xx.php file?
    It is hard for me to create the html structure inside a php while. Im doing something that does not seems elegant at all for me ??

    			while ( have_posts() ) : the_post();
    
    				/*
    				 * We remove the get_template_part()
    				 */
    
    				the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
    				echo "<h5>Fecha </h5>";
    				echo(types_render_field( "fecha", array("post_id"=>$my_post )) );
    				echo " </br><h5>Longitud</h5> ";
    				echo types_render_field( "longitud");
    				echo " </br><h5>Circular / Ida y vuelta: </h5>";
    				echo types_render_field( "circular");
    				echo " <h5>Denivel acumulado: </h5>";
    				echo types_render_field( "desnivel-acumulado");
    				echo " </br><h5>Dificultad </h5>";
    				echo types_render_field( "dificultad");
    
    			endwhile;

    So it sound good for me to call to another archive and make the html there.

    The issue was that content-customtype.php also impact in custom type single view. Then I tried to create childtheme/template-parts/content-customtype2.php and call it using
    get_template_part( 'template-parts/content-customtype2', get_post_format() );

    But it does not works. What do you advise? Thanks in advance.

    Thread Starter Astilla VGR

    (@astilla222)

    @joyously I have created the following doc:

    childtemplate/template-parts/content-customtype.php

    trying to override

    template/template-parts/content-customtype.php

    This is the function looking for this archive on archive-customtype.php
    get_template_part( ‘template-parts/content’, get_post_format() );

    But it seems not working. I have read the documentation but i do not find the solution.

    thanks in advance!

    Thread Starter Astilla VGR

    (@astilla222)

    Thanks a lot for the reply! Indeed the issue was not have the same folder structure.

    Thread Starter Astilla VGR

    (@astilla222)

    The issue seems to be in the following function:
    get_template_part( ‘template-parts/content’, get_post_format() );

    Should I modify it to make it read templates/childtemplate/content-programada.php?

    Thread Starter Astilla VGR

    (@astilla222)

    I have found that the issue is the following:
    File 1: templates/childtemplate/content-programada.php
    File 2: templates/template/content.php

    I expect to have File 1 (custom) layout, but I keep watching File 2 (original) layout.

    Have i created the archive with the wrong name or in the wrong folder?

Viewing 5 replies - 16 through 20 (of 20 total)