-
AuthorPosts
-
December 11, 2019 at 12:03 pm #1164785
Hi,
the accordion tab #urls arent really seo friendly. google detect it as mutliple sites (because multiple URLs) and not as a single site.
i need to completely remove all the urls like this #toggle-id-1, #toggle-id-2, #toggle-id-3, #toggle-id-1-closed … and so on.i dont need the prettier urls … i need to completely remove the urls
is this possbile?This code didnt worked and its buggy … the page kept on loading (blinking, actually)
function add_custom_target(){
?>
<script>
jQuery(window).load(function(){
document.location.href = String( document.location.href ).replace( “#/”, “” );
});
</script>
<?php
}
add_action(‘wp_footer’, ‘add_custom_target’);thx a lot for helping me out
ak-muc- This topic was modified 4 years, 11 months ago by ak-muc.
December 12, 2019 at 6:25 am #1165074Hey ak-muc,
Thank you for the inquiry.
This is possible, but you have to modify the wp-content\themes\enfold\config-templatebuilder\avia-shortcodes\toggles\toggles.js file directly. Comment out or remove line 82 and 121.
82:
location.replace(thisheading.data('fake-id') + "-closed");
121:
location.replace(thisheading.data('fake-id'));
Best regards,
IsmaelDecember 12, 2019 at 10:36 am #1165145Ok thx for youre reply … i need to delete them after every update or its possible within child theme?
December 13, 2019 at 9:48 am #1165443Hi,
Thank you for following up.
You can override the shortcode in the child theme. Please check the documentation below.
// https://kriesi.at/documentation/enfold/intro-to-layout-builder/#add-elements-to-alb
You have to modify the extra_assets function around line 77 and make it load the script from the child theme.
function extra_assets() { //load css wp_enqueue_style( 'avia-module-toggles', AviaBuilder::$path['pluginUrlRoot'] . 'avia-shortcodes/toggles/toggles.css', array( 'avia-layout' ), false ); //load js wp_enqueue_script( 'avia-module-toggles', AviaBuilder::$path['pluginUrlRoot'] . 'avia-shortcodes/toggles/toggles.js', array( 'avia-shortcodes' ), false, true ); }
Best regards,
IsmaelDecember 13, 2019 at 10:37 am #1165455Ok thank You … i will try it
December 14, 2019 at 6:14 am #1165771Hi,
Thanks for the update. Please let us know if you should need any further help on the topic or if we can close it.
Best regards,
RikardMay 16, 2024 at 2:45 pm #1443888Hi Ismael
Can you please be more specific about where to find the extra_assets?
Best regards,
MajaMay 16, 2024 at 3:06 pm #1443896Hi,
Please refer to this: https://kriesi.at/documentation/enfold/accordion/#custom-tab-and-toggle-ids-for-prettier-url-hashes
Best regards,
RikardMay 16, 2024 at 9:16 pm #1443947Hi Rikard
Thank you for your reply.
I have tried to add this code snippet to functions.php – add_theme_support(‘avia_template_builder_custom_tab_toogle_id’); – as the guide tells me to do. But unfortunately it doesn’t work.
Is there any other solution that can help me remove toggle-id’s from the URL?Best regards,
MajaMay 17, 2024 at 8:59 am #1444038Hi,
The code will add a new field in the element options, so that you can name the anchors yourself.
Best regards,
RikardMay 21, 2024 at 8:55 am #1444877Hi Rikard
I have added the code snippet, but unfortunately a new field is not showing in the element options. But I don’t see the field “toggle sorting tags” either, so I don’t know if something is wrong? I’m working in the Enfold version 5.2.1.
Best regards,
MajaMay 21, 2024 at 12:33 pm #1444906Hi Maja,
Please open a new thread and include WordPress admin login details in private, so that we can have a closer look at your site. We’ll close this thread for now.
Best regards,
Rikard -
AuthorPosts
- The topic ‘remove all accordion tab # urls like #toggle-id-1, #toggle-id-1-closed …’ is closed to new replies.