Skip Navigation

[Gelöst] WP Archives the Category Name isn’t showing properly / at all.

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

Problem:
How to remove word "Category:" from caregory archive and display only archive title.

Solution:
To remove the "Cateogry:" word fro archive page you need to add a custom shortcode to your current theme's functions.php file.

Code : https://toolset.com/forums/topic/wp-archives-the-category-name-isnt-showing-properly-at-all/#post-369519

And call the shortcode, for example:

<h1> Hello, this is the '[wpv-archive-title]' category</h1>
This support ticket is created vor 6 Jahre, 11 Monate. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 3 Antworten, has 2 Stimmen.

Last updated by cathieH vor 6 Jahre, 10 Monate.

Assigned support staff: Minesh.

Author
Artikel
#369429

I am trying to: show the archive category name above the loop

I visited this URL: hidden link

I expected to see: Hello, this is the 'Photography' category

Instead, I got: Hello, this is the '' category

I've used this code in my views wp archive and its not outputting the category name.

<h1> Hello, this is the '[wpv-post-taxonomy type='category' format='name']' category</h1>

It seems a simple thing to do but its not displaying correctly.

Can you help?

Thanks
Cathie.

#369438

Here is the full code of the archive and you can see that I've put the archive title outside the Views Loop

[wpv-layout-start]
<h1> Hello, this is the '[wpv-post-taxonomy type='category' format='name']' category</h1>
	[wpv-items-found]
<h2>[wpv-post-taxonomy type='category']</h2>
	<!-- wpv-loop-start -->
		<wpv-loop>
          <div class="blogpost">
          <h1>[wpv-post-link]</h1>
          [wpv-post-featured-image class="image-left"]
            [wpv-post-excerpt length='80' count='word' class='excerpt-right'] ... <a href="[wpv-post-url]">read more</a>.
          <div>Date: [wpv-post-date format='d M Y']
            </div>
          </div>
          
          <div class="clearboth"></div>
           
		</wpv-loop>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
	[/wpv-no-items-found]
[wpv-layout-end]
#369519

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Could you please try to add following shortcode to your current theme's functions.php file:

add_shortcode('wpv-archive-title', 'wpv_archive_title_func');
function wpv_archive_title_func($atts, $content){
    $x = split(":",get_the_archive_title());
    $x = $x[count($x)-1];
    return $x;
}

Call the shortcode, for example:

<h1> Hello, this is the '[wpv-archive-title]' category</h1>

I hope this solution will help you to resolve your issue.

#374220

Thank you, I appreciate your help and the solution. 🙂