Viewing 19 posts - 1 through 19 (of 19 total)
  • Author
    Posts
  • #1307809

    Hello,
    recently you fixed the product category archive layout in this thread
    https://kriesi.at/support/topic/woocommerce-category-description-displayed-in-title-header/
    so that we could have h1 in the title banner, and a term description below, before the product loop.
    Succesful example:
    https://www.officinadeiricordi.it/categoria-prodotto/vetrina-affettatrici-volano-berkel/

    Now I noticed that the tag archive has more or less the same problem.
    As you see here:
    https://www.officinadeiricordi.it/tag-prodotto/altre-origini/
    there is not h1, and the term description appears twice.
    Plus there is not banner support, but this is the less important thing.

    Is it possibile to replace the first term description with h1 with tag term name?

    Thank you!

    #1307908

    Hey marcie73,

    Thank you for the inquiry.

    For the tag archive page, you can use this code in the functions.php file to replace div with h1.

    /**
    	 * Show an archive description on taxonomy archives.
    	 */
    	function woocommerce_taxonomy_archive_description() {
    		if ( is_product_taxonomy() && 0 === absint( get_query_var( 'paged' ) ) ) {
    			$term = get_queried_object();
    
    			if ( $term && ! empty( $term->description ) ) {
    				echo '<h1 class="term-description">' .  wp_kses_post( $term->description )  . '</h1>'; 
    			}
    		}
    	}
    

    And modify the hooks that we created previously. Try to replace it with:

    // ADD PRODUCT CATEGORY DESCRIPTION IN RIGHT PLACE
    add_action("after_setup_theme", function() {
    	if(is_product_category()) {
                 add_action( "woocommerce_before_shop_loop", "woocommerce_taxonomy_archive_description", 10 );
            }
    	add_action( "woocommerce_before_shop_loop", "woocommerce_before_shop_loop", 10 );
    }, 20);
    

    Best regards,
    Ismael

    #1307955

    Hello Ismael,
    I cloned website so you can see the result of your code applied.
    Feel free to edit directly and check the result.
    Login is the same.

    I see that you replaced a <p> with <h1> but not the dynamic content: “$term->description” is non correct, it should be maybe “$term->name”.
    I tried replacing myself, which it seems ok, but the term description, that should appear below the term name, is now missing.
    https://dev.officinadeiricordi.it/tag-prodotto/altre-origini/

    Your new piece of code affects product category archive and it reverted it as it was at the beginning (CATEGORY suffix and term description missing)
    https://dev.officinadeiricordi.it/categoria-prodotto/vetrina-affettatrici-volano-berkel/
    Compare with same page in live site:
    https://www.officinadeiricordi.it/categoria-prodotto/vetrina-affettatrici-volano-berkel/

    Have a look also at the code in fuctions.php at row 125 which was added to optimize category archives. I placed in now in upper position, i think you missed it.
    Thank you!

    #1308131

    Hi,

    Where did you add the code? We cannot find it in the functions.php file. Duplicating the function might break the site, so we did not add it.

    Best regards,
    Ismael

    #1308153

    in functions.php, in child theme named “Officina dei Ricordi”
    of cloned website

    You need to access here:
    https://dev.officinadeiricordi.it/wp-admin

    see this:

    View post on imgur.com

    thanks!

    #1308709

    Hi,

    Thank you for the info.

    We modified the snippet in the functions.php file a bit. The description in the tag page is now replaced with h1 tag.

    Best regards,
    Ismael

    #1308763

    Hi Isamel,
    Maybe I did not express myself properly.

    I need both:
    – h1 with term title
    and below
    – paragraph with term description.

    Same as we did for product category archives.
    Thank so much!

    #1309639

    Hi,

    Sorry for the delay. We modified the woocommerce_taxonomy_archive_description function a bit and include the taxonomy description below the title or h1 tag.

    Best regards,
    Ismael

    #1309729

    Hello Ismael,
    again your modification is affecting the category archive: no more description and there is a suffix before title.
    https://dev.officinadeiricordi.it/categoria-prodotto/vetrina-affettatrici-volano-berkel/
    please compare with same page in live site
    https://www.officinadeiricordi.it/categoria-prodotto/vetrina-affettatrici-volano-berkel/
    Thank you

    #1309922

    Hi,

    We modified the code a bit to remove the prefix from the category title and show the category description. We also adjusted it to remove the duplicate tag title. This is the final code.

    // https://pastebin.com/JxwayjRJ

    Best regards,
    Ismael

    #1310095

    Hello Ismael,
    yes tag archive seems fine but now there is something that is breaking the code in the category archive.
    https://dev.officinadeiricordi.it/categoria-prodotto/vetrina-affettatrici-volano-berkel/
    A you see the shortcode [expand title=”Leggi di più”] is not rendered, and if you compare the same page in live site, there is a different div nidification.
    An there is a paragraph with class “ptag” I created for tag archive, appearing in there (empty)
    As I understood these 2 archives (category and tag) differ but, at the same time, share some code and this is quite messy.
    I still don’t understand why these 2 archives should differ, would not be better if they could have the same template?
    I think this should be an issue with priority for theme fixing.
    Anyway, hope that you can help me to fix it :)
    Thank you!

    #1310605

    Hi,

    The layout of archive (tag and category) pages are default templates from the shop plugin. The theme just adds the parallax option to the category, so what you are requesting here are actually custom modifications, which are beyond the scope of support. The shortcode [expand title=”Leggi di più”] is also not from theme and we do not know where it come from or what it does.

    We have already provided the starting code and changes in the previous thread and recommended some other modifications above. Please hire a freelance developer to extend it or contact our partner, Codeable for further modifications.

    Best regards,
    Ismael

    #1310730

    Hello Ismael,
    sorry, yes I forgot to tell you more about this little shortocode, it is just a simple plugin than can be used in the wordpress editor, and works also in category and tag description editor. It toggles a piece of text.
    I pointed out that is was not rendered correctly, so I thought there was something wrong with the div nidification.
    I checked with more attention the html output and I saw that the wrapping div “term-description” (it is rendered using the woocommerce function woocommerce_taxonomy_archive_description”) is missing, and this happened since you added the code for the tag archive.
    This div should appears right after the “woocommrce-notice-wrapper”(compare with live site)

    Please can you check further more if there is any error?
    (I also report that at line 112-115 there is a spelling error “ava” instead of “avia”. I tried to correct but things getting worse.)

    I don’t know if this is beyond the scope of a support: In Enfold you have a term description in the <H1> tag of the parallax banner and this is very wrong.
    I really appreciated your commitment until now to solve this issue in category archive and in tag archive, and hope that you understand the importance of this request. In my opinion this must a priority in the task list to improve Enfold theme.

    Thank you again!

    #1311020

    Hi,

    In Enfold you have a term description in the h1 tag of the parallax banner and this is very wrong.

    I believe we already adjusted this previously, but for some reason it was reverted back to h1. We edited the functions.php file again.

    $output .= "<h1>".get_the_archive_title()."</h1>";
    if(false) $output .= "".$description."";
    

    Please note that this is already a modified parallax banner based on your previous requests. By default, the theme only renders the description in the parallax banner, not the title.

    Unfortunately, we are still not sure why the custom shortcode is not working. You will have to hire a freelance developer for further modifications.

    Best regards,
    Ismael

    #1311126

    Hello Ismael,
    well, I managed to fix it. And I know nothing about php.

    I know we fixed the title in the previous request. I meant to say that what is set “by default” in the theme is wrong!
    That’s the problem. Your theme is not SEO friendly, and you don’t seem to understand that fix this issue should be your priority.
    I recommend to add this issue to development task list.

    Best regards

    #1311747

    Hi,

    Why is it wrong to have an h1 tag in the page? This is the only h1 tag in the archive or category page, it has no duplicate, so it should be valid. Yes, it is not the archive or category title, but it is not wrong to wrap the description in an h1 tag, specially when the text or description fully describes the page. But this is no longer an issue in your site since we have already added the category title, wrapped it in an h1 tag and replaced the description with a paragraph tag.

    Best regards,
    Ismael

    #1311839

    Hi Ismael,
    It’s not wrong at all having an H1, in the contrary, it is essential, but along with a separate description.
    For SEO purpose, each page of a website should have at least 1 title (h1) and this should match the page title.
    and 1 LONG description (min 300 words). In the description it is a good practice to add also h2 and h3 titles but these can be added in the editor.
    So I cannot add a long description in H1 because it will look huge (as happened when it was in the category banner title), and anyway, I need both.
    Search engines spiders must recognise titles and description separately.

    Yes, this is no longer an issue, we fixed it, but in my opinion you should fix both archives to have, by default, an h1 (term title) and separate div for the description, exactly as it appears in the backend. But this is for your interest, not mine anymore. I mean, If I were a theme developer, I would care to make my theme the best theme ever, and with seo in mind, when thinking about the html structure.
    Thank you anyway. :)

    #1311950

    Sorry Ismael, did you create a user called “test” on 20th of July?

    #1312317

    Hi,

    No, we did not create any user on July 20th.

    Best regards,
    Ismael

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