• Resolved wallacelin

    (@wallacelin)


    Hello, I am using WP Manager to add a career section to my client’s website. I followed your documentation, enabled full template support in my child themes, and added the three archive files (archive-job_listing.php, taxonomy-job_listing_category.php, and taxonomy-job_listing_type.php). I would like to add headers to the archives to show what category or type is being displayed.

    How can I retrieve and output the category and type names as archive titles?

    Would be great if this is possible, please let me know. Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @wallacelin ,

    I do not know what do you mean exactly.

    If you want to change <title> for job_category etc. and you are using Yoast SEO, then you have to use the following function in your functions.php:

    add_filter('wpseo_title', 'filter_product_wpseo_title');
    function filter_product_wpseo_title($title) {
        if(  is_tax( 'job_listing_category') ) {
            $title = 'Your title';
        }
        return $title;
    }

    If you want to just in HTML names of your single taxonomy, here you are:

    Code for current single taxonomy:
    <?php single_term_title(); ?>

    And here little bit longer version:

    <?php $tax = $wp_query->get_queried_object();
    $tax_term = $tax->name;
    $tax = get_taxonomy($tax->taxonomy);
    $taxonomy =  $tax->label;
    echo "Current slug: <b>".$tax_term."</b>";
    echo " | It is in: <b>".$taxonomy;"</b>" ?>

    If you have any questions, please let me know.

    the problem is this in

    https://lemigliorimacellerieditalia.com/lista-macellerie/

    i don’t want see the map

    and i want see listing category without map . is possibile ? thank

    please give me , if posssibile , the name file .php and the code thank

    Thread Starter wallacelin

    (@wallacelin)

    Hello @kibus90,

    Thank you, <?php single_term_title(); ?> is what I was looking for in order to add the current taxonomy term name as page title. This works perfectly. Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Show Category/Type Titles on Archives’ is closed to new replies.