Home / Forums / WoodMart support forum / Display block H1 for the root page/Вывод блока H1 для корневой страницы Рубрики
Home › Forums › WoodMart support forum › Display block H1 for the root page/Вывод блока H1 для корневой страницы Рубрики
Display block H1 for the root page/Вывод блока H1 для корневой страницы Рубрики
- This topic has 13 replies, 2 voices, and was last updated 6 years, 1 month ago by
Elise Noromit.
-
AuthorPosts
-
May 2, 2020 at 6:11 pm #191796

detroyt86Participantgood evening
How to do for Category
http://joxi.ru/82QOLpYiwgOWYr
http://beta.aquaworks.com.ua/obsluzhivanie-vodoemov/same block with H1 as output for Records
http://joxi.ru/5mdvBN7h35XOvA
http://beta.aquaworks.com.ua/obsluzhivanie-vodoemov/zapusk-vodoema-vesnoy/************
Добрый вечер
Как вывести для Рубрики
http://joxi.ru/82QOLpYiwgOWYr
http://beta.aquaworks.com.ua/obsluzhivanie-vodoemov/такой же блок с Н1 как выводится для Записей
http://joxi.ru/5mdvBN7h35XOvA
http://beta.aquaworks.com.ua/obsluzhivanie-vodoemov/zapusk-vodoema-vesnoy/May 2, 2020 at 8:33 pm #191826
Elise NoromitMemberHello,
In order to show the title in the Shop page that would be inherited by the category page, you need to configure showing the title in the Theme settings > Shop page > Sidebar and title. In addtions check the shop page custom settings and make sure the title has not been disabled.
The same should be done for the blog page: Theme Settings > Blog.
Best Regards
May 6, 2020 at 6:50 pm #192883
detroyt86ParticipantHow to change H1 to h4?
http://joxi.ru/EA4X4nkfo9LadA
http://beta.aquaworks.com.ua/obsluzhivanie-vodoemov/For the root page of the category, the big problem is that H1 is used 2 times
May 7, 2020 at 11:27 am #193089
Elise NoromitMemberHello,
Please find the function
woodmart_page_title()https://gyazo.com/328281081c2063d52c315c32e66f7bf4in this file: woodmart\inc\template-tags.php
Copy it in the functions.php of the child theme and change as per your needs.
Best Regards
May 7, 2020 at 12:09 pm #193111
detroyt86ParticipantThank! This is what I need
I found this piece of code
I am not good at programming. What should be the code to Change H1 to H4?Спасибо! Это то что мне нужно
Я нашел вот такой кусок кода
Я плохо разбираюсь в программировании. Каким должен быть код чтобы Изменить H1 на Н4?if( ! function_exists( 'woodmart_page_title' ) ) { add_action( 'woodmart_after_header', 'woodmart_page_title', 10 ); function woodmart_page_title() { global $wp_query, $post;May 7, 2020 at 4:34 pm #193220
Elise NoromitMemberHello,
Here is the code:
add_action( 'woodmart_after_header', 'woodmart_page_title', 10 ); function woodmart_page_title() { global $wp_query, $post; // Remove page title for dokan store list page if( function_exists( 'dokan_is_store_page' ) && dokan_is_store_page() ) { return ''; } $page_id = 0; $disable = false; $page_title = true; $breadcrumbs = woodmart_get_opt( 'breadcrumbs' ); $image = ''; $style = ''; $page_for_posts = get_option( 'page_for_posts' ); $page_for_shop = get_option( 'woocommerce_shop_page_id' ); $page_for_projects = woodmart_tpl2id( 'portfolio.php' ); $title_class = 'page-title-'; $title_color = $title_type = $title_size = 'default'; // Get default styles from Options Panel $title_design = woodmart_get_opt( 'page-title-design' ); $title_size = woodmart_get_opt( 'page-title-size' ); $title_color = woodmart_get_opt( 'page-title-color' ); $shop_title = woodmart_get_opt( 'shop_title' ); $shop_categories = woodmart_get_opt( 'shop_categories' ); $single_post_design = woodmart_get_opt( 'single_post_design' ); // Set here page ID. Will be used to get custom value from metabox of specific PAGE | BLOG PAGE | SHOP PAGE. $page_id = woodmart_page_ID(); if( $page_id != 0 ) { // Get meta value for specific page id $disable = get_post_meta( $page_id, '_woodmart_title_off', true ); $image = get_post_meta( $page_id, '_woodmart_title_image', true ); $custom_title_color = get_post_meta( $page_id, '_woodmart_title_color', true ); $custom_title_bg_color = get_post_meta( $page_id, '_woodmart_title_bg_color', true ); if( $image != '' ) { $style .= "background-image: url(" . $image . ");"; } if( $custom_title_bg_color != '' ) { $style .= "background-color: " . $custom_title_bg_color . ";"; } if( $custom_title_color != '' && $custom_title_color != 'default' ) { $title_color = $custom_title_color; } } if ( $title_design == 'disable' ) $page_title = false; if ( ! $page_title && ! $breadcrumbs ) $disable = true; if ( is_single() && $single_post_design == 'large_image' ) $disable = false; if ( $disable ) return; $title_class .= $title_type; $title_class .= ' title-size-' . $title_size; $title_class .= ' title-design-' . $title_design; if ( $single_post_design == 'large_image' && is_single() ) { $title_class .= ' color-scheme-light'; }else{ $title_class .= ' color-scheme-' . $title_color; } if ( $single_post_design == 'large_image' && is_singular( 'post' ) ) { $image_url = get_the_post_thumbnail_url( $page_id ); if ( $image_url && ! $style ) $style .= "background-image: url(" . $image_url . ");"; $title_class .= ' post-title-large-image'; ?> <div class="page-title <?php echo esc_attr( $title_class ); ?>" style="<?php echo esc_attr( $style ); ?>"> <div class="container"> <header class="entry-header"> <?php if ( get_the_category_list( ', ' ) ): ?> <div class="meta-post-categories"><?php echo get_the_category_list( ', ' ); ?></div> <?php endif ?> <h1 class="entry-title"><?php the_title(); ?></h1> <div class="entry-meta woodmart-entry-meta"> <?php woodmart_post_meta(array( 'labels' => 1, 'author' => 1, 'author_ava' => 1, 'date' => 1, 'edit' => 0, 'comments' => 1, 'short_labels' => 0 )); ?> </div> </header> </div> </div> <?php return; } // Heading for pages if( is_singular( 'page' ) && ( ! $page_for_posts || ! is_page( $page_for_posts ) ) ): $title = get_the_title(); ?> <div class="page-title <?php echo esc_attr( $title_class ); ?>" style="<?php echo esc_attr( $style ); ?>"> <div class="container"> <header class="entry-header"> <?php if ( woodmart_woocommerce_installed() && ( is_cart() || is_checkout() ) ): ?> <?php woodmart_checkout_steps(); ?> <?php else: ?> <?php if( $page_title ): ?><h4 class="entry-title"><?php echo esc_html( $title ); ?></h4><?php endif; ?> <?php if ( $breadcrumbs ) woodmart_current_breadcrumbs( 'pages' ); ?> <?php endif ?> </header><!-- .entry-header --> </div> </div> <?php return; endif; // Heading for blog and archives if( $single_post_design != 'large_image' && is_singular( 'post' ) || woodmart_is_blog_archive() ): $title = ( ! empty( $page_for_posts ) ) ? get_the_title( $page_for_posts ) : esc_html__( 'Blog', 'woodmart' ); if( is_tag() ) { $title = esc_html__( 'Tag Archives: ', 'woodmart') . single_tag_title( '', false ) ; } if( is_category() ) { $title = '<span>' . single_cat_title( '', false ) . '</span>'; } if( is_date() ) { if ( is_day() ) : $title = esc_html__( 'Daily Archives: ', 'woodmart') . get_the_date(); elseif ( is_month() ) : $title = esc_html__( 'Monthly Archives: ', 'woodmart') . get_the_date( _x( 'F Y', 'monthly archives date format', 'woodmart' ) ); elseif ( is_year() ) : $title = esc_html__( 'Yearly Archives: ', 'woodmart') . get_the_date( _x( 'Y', 'yearly archives date format', 'woodmart' ) ); else : $title = esc_html__( 'Archives', 'woodmart' ); endif; } if ( is_author() ) { /* * Queue the first post, that way we know what author * we're dealing with (if that is the case). * * We reset this later so we can run the loop * properly with a call to rewind_posts(). */ the_post(); $title = esc_html__( 'Posts by ', 'woodmart' ) . '<span class="vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '" title="' . esc_attr( get_the_author() ) . '" rel="me">' . get_the_author() . '</a></span>'; /* * Since we called the_post() above, we need to * rewind the loop back to the beginning that way * we can run the loop properly, in full. */ rewind_posts(); } if( is_search() ) { $title = esc_html__( 'Search Results for: ', 'woodmart' ) . get_search_query(); } ?> <div class="page-title <?php echo esc_attr( $title_class ); ?> title-blog" style="<?php echo esc_attr( $style ); ?>"> <div class="container"> <header class="entry-header"> <?php if( $page_title && is_single() ): ?> <h3 class="entry-title"><?php echo wp_kses( $title, woodmart_get_allowed_html() ); ?></h3> <?php elseif( $page_title ): ?> <h1 class="entry-title"><?php echo wp_kses( $title, woodmart_get_allowed_html() ); ?></h1> <?php endif; ?> <?php if ( $breadcrumbs && ! is_search() ) woodmart_current_breadcrumbs( 'pages' ); ?> </header><!-- .entry-header --> </div> </div> <?php return; endif; // Heading for portfolio if( is_singular( 'portfolio' ) || woodmart_is_portfolio_archive() ): if ( woodmart_get_opt( 'single_portfolio_title_in_page_title' ) ) { $title = get_the_title(); } else { $title = get_the_title( $page_for_projects ); } if( is_tax( 'project-cat' ) ) { $title = single_term_title( '', false ); } ?> <div class="page-title <?php echo esc_attr( $title_class ); ?> title-blog" style="<?php echo esc_attr( $style ); ?>"> <div class="container"> <header class="entry-header"> <?php if( $page_title ): ?><h1 class="entry-title"><?php echo esc_html( $title ); ?></h1><?php endif; ?> <?php if ( $breadcrumbs ) woodmart_current_breadcrumbs( 'pages' ); ?> </header><!-- .entry-header --> </div> </div> <?php return; endif; // Page heading for shop page if( woodmart_is_shop_archive() && ( $shop_categories || $shop_title ) ): if( is_product_category() ) { $cat = $wp_query->get_queried_object(); $cat_image = woodmart_get_category_page_title_image( $cat ); if( $cat_image != '') { $style = "background-image: url(" . $cat_image . ")"; } } if( is_product_category() || is_product_tag() ) { $title_class .= ' with-back-btn'; } if( ! $shop_title ) { $title_class .= ' without-title'; } ?> <?php if ( apply_filters( 'woocommerce_show_page_title', true ) && ! is_singular( "product" ) ) : ?> <div class="page-title <?php echo esc_attr( $title_class ); ?> title-shop" style="<?php echo esc_attr( $style ); ?>"> <div class="container"> <div class="nav-shop"> <div class="shop-title-wrapper"> <?php if ( is_product_category() || is_product_tag() ): ?> <?php woodmart_back_btn(); ?> <?php endif ?> <?php if ( $shop_title ): ?> <h1 class="entry-title"><?php woocommerce_page_title(); ?></h1> <?php endif ?> </div> <?php if( ! is_singular( "product" ) && $shop_categories ) woodmart_product_categories_nav(); ?> </div> </div> </div> <?php endif; ?> <?php return; endif; }Replace the H tags
Best Regards
May 8, 2020 at 7:23 am #193354
detroyt86Participantgood afternoon
Thanks for the help but for some reason does not workI copied your code in functions.php for child theme
Then I activated the child theme (http://joxi.ru/krDjR1OhK61z42). Nothing has changed.Through find-replace, I fixed h1 in h4 in your code and tried again – nothing has changed. I attach both files with the code.
Добрый день Спасибо за помощь но почему то не работает
Я скопировал ваш код в functions.php для child theme
Потом активировал дочернюю тему. Ничего не поменялось.
Через найти-заменить я исправив в вашем коде н1 на н4 и снова попробовал – ничего не помменялось
прикрепляю оба файла с кодомMay 8, 2020 at 12:22 pm #193460
Elise NoromitMemberHello,
Please provide your FTP access to the private area.
Best Regards
May 9, 2020 at 1:16 pm #193664
detroyt86Participantgood afternoon
Good. Send your ip address from which you will goДобрый день
Хорошо пришлите свой айпи адрес с которого вы будете заходитьMay 9, 2020 at 8:00 pm #193731
Elise NoromitMemberHello,
Please disable the blocking configuration for a while. I am not sure who will look in it and perhaps It would be two or more IPs.
Best Regards
May 10, 2020 at 2:11 pm #193858
detroyt86ParticipantGood afternoon Access for FTP is open
May 11, 2020 at 7:09 am #193987
Elise NoromitMemberHello,
Our developers have corrected already please check.
Best Regards
May 13, 2020 at 2:36 pm #194669
detroyt86ParticipantThank! Problem resolved
May 13, 2020 at 3:38 pm #194693
Elise NoromitMemberYou are welcome! If you have any questions please feel free to contact us.
Best Regards
-
AuthorPosts
The topic ‘Display block H1 for the root page/Вывод блока H1 для корневой страницы Рубрики’ is closed to new replies.
- You must be logged in to create new topics. Login / Register