• finwin

    (@finwin)


    Hi,

    I’d like to use Twenty-Twenty, but need some customization. There is something I don’t get.

    I have created a child theme, but I don’t understand how to customize the_content. In folder template-parts i see content.php, but it seems that almost everything (date, content itself, tags) comes “as one package” with the_content. How is it possible for example to customize date and time format or move tags before content or do other that sort of stuff?

    With traditional themes it was so easy with template tags.

    Thank’s!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Kathryn Presner

    (@zoonini)

    Hi @finwin

    How is it possible for example to customize date and time format

    The date and time format is normally set in Settings > General. Most themes should follow the format set here:

    General Settings Self hosted Test WordPress

    move tags before content or do other that sort of stuff?

    If you’re referring to post tags, those are part of something called “post meta” found here in content.php:

    // Single bottom post meta.
        twentytwenty_the_post_meta( get_the_ID(), 'single-bottom' );
    

    So you can try moving that to your preferred location, in your child theme.

    With traditional themes it was so easy with template tags.

    Twenty Twenty is a classic theme (not a block theme) created several years ago at this point, so I’m curious as to what “traditional theme” you’re referring to?

    Thread Starter finwin

    (@finwin)

    Hi @zoonini,

    Thank you very much for kind answer!

    The date and time format is normally set in Settings > General.

    The current theme I use filter that shows the_time() following:

    7:30 (If today just the time)
    11.10. 7:30 (Date and time if previous date, but same year)
    11.10.2019 (Date and year if previous year)

    I haven’t been able to get filter(s) to work with Twenty Twenty.

    So you can try moving that to your preferred location, in your child theme.

    Sorry, I still don’t get how to got template to pieces. Now I am just using template tags like that:

    
    
    <h2 id="post-<?php the_ID(); ?>"><?php the_title(); ?></h2>
    	
    <?php the_subtitle('<h3>', '</strong></h3>'); ?>
    
    <?php dynamic_sidebar( 'sidebar-1' ); ?>
    	
    <p class="small">
    <?php the_category( ' &middot; ' ); ?>
    <?php the_time()  ?>
    </p>
    
    <?php the_author_posts_link(); ?>
    
    <div class="excerpt"><?php the_excerpt(''); ?></div>
    	
    <div class="entry"><?php the_content('More'); ?></div>
    
    

    There must be something here that I can’t think of correctly!

    I’m curious as to what “traditional theme” you’re referring to?

    I have used Corp by SiteOrigin as a starter.

    Moderator Kathryn Presner

    (@zoonini)

    The current theme I use filter that shows the_time() following:

    Ah, gotcha – so your theme is overriding the built-in WordPress post date system. Since functions like this are usually theme-specific, it’s expected that it wouldn’t work with a different theme. Perhaps you can find a plugin that does something similar, without requiring a manual rewrite of the function to work with a specific theme?

    Sorry, I still don’t get how to got template to pieces.

    It might help to have a look at this explanation of how theme files are organized in many classic themes, including the more recent Twenties (prior to Twenty Twenty-Two):

    https://developer.www.ads-software.com/themes/basics/organizing-theme-files/

    Hi team,

    MY code not working

    twentytwenty_the_post_meta( get_the_ID(), ‘single-bottom’ )

    twentytwenty_the_post_meta( get_the_ID(), ‘single-top’ );

    time is coming from single-top but if i am placing single top below single bottom its not working

    Hi @ritushrivatri, could you please share a little bit more code to understand where you are using those two functions?

    Also, when you say “it is not working”, what are you seeing? Are you getting an error? Is the output blank?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Theme customization’ is closed to new replies.