Site logo

[Resolved] Show category over post-title

Home Forums Support [Resolved] Show category over post-title

Home Forums Support Show category over post-title

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1572649
    Jens

    Hello,

    I want to move the category over the heading (generate_before_entry_title). The tags should remain below the post. How can this be achieved?

    I am using a child theme.
    Can this be done via a filter in the funktions.php, with hooks or do I need a new template?

    Thank you for your response.

    #1572743
    David
    Staff
    Customer Support

    Hi there,

    can you share a link to your site so i can see the current layout?
    And do you want to move this on Acrhives or single posts or both.

    #1572801
    Jens

    https://lichtenberg.info/

    Both. Archive and single-post

    #1573008
    Jens

    Hello David,

    I was able to solve part of the problem. The category is displayed correctly. But it is not a link, just text.
    I used this filter in functions.php:

    add_filter( 'generate_hooks_execute_php', '__return_true' );
    

    and this hook:

    <div class="navigation-title-container">
        <div class="navigation-category">
            <?php
            $category = get_the_category(); 
            echo $category[0]->cat_name;
            ?>
        </div>
    </div>

    I need an idea for the category link

    Many thanks

    #1573015
    David
    Staff
    Customer Support

    OK so instead of:

    <?php
    $category = get_the_category(); 
    echo $category[0]->cat_name;
    ?>

    Try:

    <?php echo generate_do_post_meta_item( 'categories' ); ?>

    #1573040
    Jens

    I am happy. Thank you very much.

    #1573046
    David
    Staff
    Customer Support

    Glad to hear that!

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.