Tagged: x
-
AuthorPosts
-
August 29, 2016 at 9:23 am #1151795
alriteamParticipantHello,
I would like to add custom id only on my home page of body tag like <body id=”temp” class=””>.
Wordpress – 4.5.3
X theme – 4.6.1
Cornerstone – 1.3Thanks in advance.
August 29, 2016 at 9:44 am #1151832
ThaiModeratorHi There,
Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.
Then navigate to your child theme’s /framework/views/integrity directory create a file named content.php and paste the code below:<?php // ============================================================================= // VIEWS/GLOBAL/_HEADER.PHP // ----------------------------------------------------------------------------- // Declares the DOCTYPE for the site and includes the <head>. // ============================================================================= ?> <!DOCTYPE html> <!--[if IE 9]><html class="no-js ie9" <?php language_attributes(); ?>><![endif]--> <!--[if gt IE 9]><!--><html class="no-js" <?php language_attributes(); ?>><!--<![endif]--> <head> <?php wp_head(); ?> </head> <body <?php echo is_front_page() ? 'id="temp"' : ''; ?> <?php body_class(); ?>> <?php do_action( 'x_before_site_begin' ); ?> <div id="top" class="site"> <?php do_action( 'x_after_site_begin' ); ?>Hope it helps 🙂
August 29, 2016 at 10:05 am #1151863
alriteamParticipantThis reply has been marked as private.August 29, 2016 at 10:12 am #1151879
Nabeel AModeratorHi again,
Please add the following jQuery script in your Customizer via Appearance > Customize > Custom > Edit Global Javascript
jQuery(document).ready(function($){ $('body.home').attr("id", "custom-id"); });Don’t forget to clear your browser’s cache after adding the code. Let us know how this goes!
August 29, 2016 at 10:19 am #1151896
alriteamParticipantHi,
No, it did not help. Hope it does not impact my other JS, as I am trying to implement SVG animation.
August 29, 2016 at 10:23 am #1151906
Nabeel AModeratorHi again,
I see you’ve not copied the code correctly, please copy the entire code and reload the site:
jQuery(document).ready(function($){ $('body.home').attr("id", "custom-id"); });Let us know how this goes!
August 29, 2016 at 10:38 am #1151930
alriteamParticipantThanks, it worked.
August 29, 2016 at 10:40 am #1151932
JoaoModeratorGlad to hear it
Let us know if we can help with anything else.
Joao
September 9, 2016 at 4:31 am #1167767
alriteamParticipantHello,
The above code worked for Home page, same way I would like to have it for another page like /media.
Also let me know how do I specify the condition to apply certain Styles to the specific page/s only from child CSS file?
Thanks.
September 9, 2016 at 6:12 am #1167849
Paul RModeratorHi,
1. You can add this js code in Cornerstone > Settings > Custom JS
jQuery(document).ready(function($){ $('body').attr("id", "custom-id"); });2. You can add your css code in Cornerstone > Settings > Custom CSS so it will affect only that specific page.
http://screencast.com/t/qA60qqmg
Thanks
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1151795 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
