Okay
  Public Ticket #1591221
Customization
Closed

Comments

  • Carlos started the conversation

    Hi, Good Day.

    I would like to add Category before entry-title.

    Can you explain me how-to?

    Thanks!

  •  723
    Marc replied

    Hi Carlos,

    if I understand you correctly you want to print the category your posts are assigned to in front of their title, so that the post title looks like:

    Category: Post Title

    Unfortunately Suidobashi doesn't provide such an option. You'd need to customize the theme code to implement this feature. I strongly recommend using a child theme for direct code adjustments. A prepared child theme folder is linked in the Suidobashi documentation.

    Please understand that we cannot provide support for individual customizations.

    If you're willing to touch the code, I can at least give you some hints where to start.

    Best,
    Marc

  • Carlos replied

    Hi Marc, thanks for the prompt reply :-)

    That's exactly what I want:

    Category: Post Title

    If you could just tell me the class and where to insert it on single and front page, that would be great.

    No need for child theme :-)

    Thanks!

  •  723
    Marc replied

    Hi Carlos,

    please be aware that direct theme code changes will be overwritten by theme updates.

    You'd need to implement the changes in your theme's content* files. You should find the post title in the code and use the following function to add a category in front of it: https://developer.wordpress.org/reference/functions/get_the_category/

    Best,
    Marc

  • Carlos replied

    Hi Marc, thanks!

    That's precisely what I was trying to do. However, it seems I'm not getting how to include it without breaking the line.

    I'll keep on trying :-)

    All the best, 

    Carlos

  •  723
    Marc replied

    Hi Carlos,

    you can post the used line of code and I'd take a look and try to figure out, what may be the problem.

    Best,
    Marc

  • Carlos replied

    Hi Marc, thanks!

    Here's the line, on Suidobashi, content.php.

    <div class="title-wrap">
    <header class="entry-header cf">
    <?php the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' ); ?>
    </header><!-- end .entry-header -->
    </div><!-- end .title-wrap -->

    and / or

    <header class="entry-header">
    <?php the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>
    </header><!-- end .entry-header -->
  •  723
    Marc replied

    Hi Carlos,

    sorry for this misunderstanding. These are the original lines of code. If you can show me your code adjustments and tell me exactly what doesn't work as expected, I can provide some tipps.

    Best,
    Marc