Custom post type and custom taxonomy

Viewing 4 posts - 1 through 4 (of 4 total)
  • #22960
    rigor
    Participant

    Hi,
    How does this theme load the template parts?
    For example, I have a custom post type and a custom attached taxonomy to that with the custom fields (via ACF).
    To be more precise, where does the theme store archive.php so it can load the posts in the taxonomy?

    Thanks!

    #22962
    Daniel Tara
    Keymaster

    By default the theme only uses the fallback index.php file to load any template. You can manually create archive.php by duplicating index.php in a child theme although I recommend that you try and customize the post type archive using the template editor.

    #22963
    rigor
    Participant

    Looks really great, how do I create my functions, please?
    For example, inside the loop, I want to include the ACF fields.

    #22964
    Daniel Tara
    Keymaster

    You can use the 'enlightenment_entry_content' hook for that. Here’s an example:

    Place this code in your child theme’s functions.php file:

    function enlightenment_clild_meta_field() {
        $value = get_post_meta( get_the_ID(), 'field_name', true );
        printf( __( 'Field Name: %s', 'enlightenment-child' ), esc_attr( $value ) );
    }
    add_action( 'enlightenment_entry_content', 'enlightenment_clild_meta_field', 12 );
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.