-
AuthorPosts
-
January 24, 2023 at 9:25 am #1394881
Hi,
How to remove the “title attribute” in post title link, not css hide, I need delete it in the html code
January 24, 2023 at 9:28 am #1394882January 24, 2023 at 10:21 am #1394890Hi,
Thanks for contacting us!
Please refer to this post: https://kriesi.at/documentation/enfold/image/#remove-image-alt-title-on-hover
Best regards,
YigitJanuary 24, 2023 at 10:29 am #1394893Hi,
It is not image ALT, it is the “title attribute” of post title link
January 24, 2023 at 12:24 pm #1394902Hi,
The code shared in the documentation removes the title attribute from all A and IMG tagged elements.
If you would like to remove it from A tagged elements only, you can use the code as following
function remove_title_attr(){ ?> <script> jQuery(window).load(function(){ jQuery('#wrap_all a').removeAttr('title'); }); </script> <?php } add_action('wp_footer', 'remove_title_attr');
Best regards,
YigitJanuary 24, 2023 at 12:40 pm #1394907Hi,
I just want to remove the title attribute from post title link, not all A links
January 24, 2023 at 2:34 pm #1394929Hi,
Please add the following code to the bottom of the functions.php file of your child theme in Appearance > Editor
function remove_post_title_title_attr(){ ?> <script> jQuery(window).load(function(){ jQuery('.entry-title a').removeAttr('title'); }); </script> <?php } add_action('wp_footer', 'remove_post_title_title_attr');
Best regards,
YigitJanuary 25, 2023 at 3:53 am #1395028Hi, it do the work, but how to remove the ” ” in the code
I just need Title, not “Title”
January 25, 2023 at 8:13 am #1395074Hi yundian,
The “” is not part of the title, browsers just add it when you inspect an element.
You can verify this by editing the text you inspected.Best regards,
NikkoJanuary 25, 2023 at 8:18 am #1395075Hi,
In same browser, there isn’t “” in grid post title link:
It is just the title, so how to remove the “” showed in post title link of big image feature blog
January 25, 2023 at 8:29 am #1395080Hi yundian,
That’s because the anchor tag in the post title has multiple elements while the grid post title only has a single element.
The elements in the post title’s anchor tag are text and the span tag (basically it’s two nodes inside the anchor tag).
Try to edit the text and you will see it’s not included (or not editable) which suggests it’s not part of the text, also it does not render in the frontend.Best regards,
NikkoJanuary 25, 2023 at 8:52 am #1395084Thanks for explain, is it normally, there is a blank here?
January 25, 2023 at 9:03 am #1395086Hi yundian,
The blank space on the right is not part of it, do you have a white space after the title?
If does not have that space, then can you setup a staging site for us? so we can try to inspect the backend.
We will need temporary admin access on it as well, just post the credentials in private content.Best regards,
NikkoJanuary 25, 2023 at 9:21 am #1395092Hi, I didn’t have a white space after title, you can see all the titles of single feature image posts, all have the blank, please check this page: https://www.yundianseo.com/en-seo/
For some reasons, I can’t give you a admin access, the problem can be see on All Enfold websites using the single featured image posts, you can have a test.
January 25, 2023 at 10:39 am #1395101@Yigit : please think of changings inside jQuery 3.x
it is nowjQuery(window).on('load', function(){
maybe you look inside documentation too if there are older snippets.
January 25, 2023 at 2:32 pm #1395146Hi,
@yundian I cannot reproduce the issue on my test installation. Please see the private content field below for the link.
@Guenni007 I have updated the line in our documentation :)Best regards,
YigitJanuary 26, 2023 at 3:41 am #1395277January 26, 2023 at 5:46 am #1395292Hi yundian,
I tested Modern Business with Grid Layout but I don’t get the same results.
Can you try to flush out cache and temporarily deactivate all plugins and see if the problem still persists?Best regards,
NikkoJanuary 26, 2023 at 9:27 am #1395328Hi, please check the problem in my test website, page:
https://www.cheapseo.cn/google-seo/
Admin access attached
January 26, 2023 at 11:39 am #1395349For the “” problem, I didn’t need multiple elements, just a link will be ok
Do you have idea to remove the “” ?
——————————————————————————————————————–
Hi yundian,That’s because the anchor tag in the post title has multiple elements while the grid post title only has a single element.
The elements in the post title’s anchor tag are text and the span tag (basically it’s two nodes inside the anchor tag).
Try to edit the text and you will see it’s not included (or not editable) which suggests it’s not part of the text, also it does not render in the frontend.Best regards,
NikkoJanuary 26, 2023 at 11:40 am #1395350I don’t need the rel=bookmark, and want to remove the ” “
January 26, 2023 at 10:52 pm #1395463Again, from a third place: the quotation marks are not text and do not belong to the Title Text.
You can easily check this yourself by hovering the mouse over the link. Then the browser shows you the title in a tooltip.
There you see – no quotation marks. They belong to the attributes of a tag! Nothing more. As with every alt-tag, title-tag src etc. pp …__________
next: https://html.spec.whatwg.org/multipage/links.html#link-type-bookmarkwhy does it disturb your?
January 27, 2023 at 3:41 am #1395492Hi,
For SEO, I don’t want to tell Google the post titles are bookmarks
January 27, 2023 at 5:42 am #1395507Hi yundian,
Thanks for giving us admin access.
You we’re using an outdated version of Enfold (4.7.6.4) which seems to have caused that extra space, it was fixed when I updated your test website to the latest version (5.4).
As for removing the “” (this can really be ignored since it doesn’t add anything) but if you really want to remove it then, you will need to use a child theme, you can download and find instructions on how to use it here: https://kriesi.at/documentation/enfold/child-theme/ (make sure to import parent theme options).
Then in your child theme’s functions.php file, add this code (at the bottom):function avia_default_title_filter( $current_post ) { if( ! empty( $current_post['title'] ) ) { $default_heading = is_singular() ? 'h1' : 'h2'; $args = array( 'heading' => $default_heading, 'extra_class' => '' ); /** * @since 4.5.5 * @return array */ $args = apply_filters( 'avf_customize_heading_settings', $args, 'avia_default_title_filter', array( $current_post ) ); $heading = ! empty( $args['heading'] ) ? $args['heading'] : $default_heading; $css = ! empty( $args['extra_class'] ) ? $args['extra_class'] : ''; $output = ''; //$output .= "<{$heading} class='post-title entry-title ". avia_offset_class('meta', false). "'>"; $output .= "<{$heading} class='post-title entry-title {$css}' " . avia_markup_helper( array( 'context' => 'entry_title', 'echo' => false ) ) . '>'; if( ! is_singular() ) { $output .= '<a href="' . get_permalink() . '" rel="bookmark" title="' . __( 'Permanent Link:', 'avia_framework' ) . ' ' . esc_attr( $current_post['title'] ) . '">'; $output .= $current_post['title']; $output .= '</a>'; } else { $output .= $current_post['title']; } $output .= "</{$heading}>"; $current_post['title'] = $output; } return $current_post; }
Hope it helps.
Best regards,
NikkoJanuary 27, 2023 at 8:51 am #1395537Hi,
The “” problem is not important for me, but the blank problem is very bad
Could you tell me how to fix it based on Enfold (4.7.6.4)
Because a lot of changes will be removed after update the theme, we can’t do it in short time.
January 27, 2023 at 2:32 pm #1395582Hi yundian,
Please edit includes > helper-post-format.php and delete this line of code(line 79):
$output .= " <span class='post-format-icon minor-meta'></span>";
Best regards,
NikkoJanuary 28, 2023 at 2:56 am #1395690Hi,
The blank problem is still thereJanuary 28, 2023 at 8:13 am #1395695Hi yundian,
Please change also this code in line 80:
$output .= " </a>";
to:
$output .= "</a>";
Best regards,
NikkoJanuary 28, 2023 at 8:36 am #1395699Great, please close
January 28, 2023 at 8:42 am #1395703Hi yundian,
I’m glad that we could help you :)
Thanks for using Enfold and have a great weekend!Best regards,
Nikko -
AuthorPosts
- The topic ‘How to remove the “title attribute” in post title link’ is closed to new replies.