Viewing 21 posts - 1 through 21 (of 21 total)
  • Author
    Posts
  • #599156

    Hello. Let’s say you find an element like this, that you would like to add to your Enfold website. It comes with HTML, CSS and JavaScript. I’ve gotten to the point where the content is displayed on the page, but there is no styling and I don’t yet know if the JavaScript is working.

    I’m using the Enfold Child Theme. Here are my steps so ar…

    1. Download the source zip (HTML, CSS and JS)
    2. Insert a Code Block on the desired page and paste the provided HTML
    3. FTP the provided CSS and JS folders to wp-content/themes/enfold-child
    4. Using the following post from Enfold support, use functions.php
    to register the script: wp_register_script( ‘cbpFWTabs’, $template_url.’/js/cbpFWTabs.js’, ‘jquery’, “1”, true);
    and link the script: wp_enqueue_script( ‘cbpFWTabs’ );

    I’m not sure how to apply the CSS, outside of using Custom CSS within Enfold.

    Thank you,
    Ryan

    #599309

    For the CSS, step #3 didn’t work. So instead, I just tried adding the CSS to the Enfold Child stylesheet. After I did that, everything on the page disappeared.

    Trying to teach myself this, but I’m stuck.

    #599337

    Hey!

    It is possible to use the html in php page but that will leave you with static site. To add the tabs to wordpress backend it is a bit more complicated.

    However if you like to add html

    Try the following links

    https://codex.wordpress.org/Creating_a_Static_Front_Page

    NOTE: It need not be front page can be any page.

    Best regards,
    Vinay Kashyap

    #599344

    Appreciate the reply. However, you lost me with the Front Page and Static HTML stuff. I mean, I know what both mean by definition, but I don’t know how they relate to what I’ve said in this post.

    I’m not a developer, but I often come across elements like these “Tabs”, where they provide the CSS/HTML/JS and I’d like to learn the proper way to infuse them/use them with Enfold.

    What is the proper way to take elements like this, with the SOURCE code they provide and implement it with Enfold?

    Thank you,
    Ryan

    #600240

    Hi!

    Let’s make it simple.

    The HTML can be added directly in a code block or the default editor if you prefer that.

    The CSS provided will either go to the style.css file of the child theme or add it in the theme’s Quick CSS field.

    The JAVASCRIPT is a little more complicated because you have to enqueue the script files. Let’s say that you have a child theme and a folder called “js” inside. Place the custom.js file there then call it like this in the functions.php file:

    function ava_custom_script() {
       wp_enqueue_script( 'my-custom-script', get_stylesheet_directory_uri().'/js/custom.js', array('jquery'), 2, true );
    }
    add_action( 'init', 'ava_custom_script', 100 );

    Best regards,
    Ismael

    #600316

    This quick video shows me following the HTML and CSS portion of your instructions.

    Adding the CSS to Quick CSS or directly to the stylesheet causes the HTML content to disappear.

    This is done with fresh install of the latest version of Enfold. No plugins installed.

    I’m able to reproduce this on my local Enfold install (shown in video) and my online Enfold install. Feel free to log into the online version and tinker.

    Thanks,
    Ryan

    #600913

    Updated to 3.5. The issue persists.

    #600972

    Hi!

    Thank you for the video we were able to understand the issue correctly.

    The CSS is working as it is intended to. Tab contents are hidden by default and it uses js to trigger the active tabs.

    There is no problem with the theme :)

    Best regards,
    Vinay Kashyap

    #601243

    Sorry, I really don’t understand your comment “Tab contents are hidden by default”. It wouldn’t make sense to show an empty page of “tabs” until triggered. Could someone please log in have a look?

    I have followed the steps @ismael provided, adding the JAVASCRIPT since your last comment. The page is still “blank”.

    1. Added HTML via a code block
    2. Added CSS via Quick CSS
    3. Added JAVASCRIPT to functions.php as shown below

    function ava_custom_script() {
    wp_enqueue_script( ‘my-custom-script’, get_stylesheet_directory_uri().’/js/cbpFWTabs.js‘, array(‘jquery’), 2, true );
    }
    add_action( ‘init’, ‘ava_custom_script’, 100 );

    #602458

    Hi @rlogan2334
    I do the same test as you: fresh WordPress, fresh 3.5.1 Enfold, Enfold child theme and it works. Why ?
    It’s because of the Responsive Full Width Tabs CSS that conflicts with Enfold CSS
    You cant use as it a CSS and hope it works out the box in a theme /-)

    Responsive Full Width Tabs CSS use .content class > conlfict
    Responsive Full Width Tabs CSS use .tabs class > conlfict
    Responsive Full Width Tabs CSS use .tab class > conlfict

    Try first to rename all Responsive Full Width Tabs CSS class with other class name.

    After that don’t put all your code in an Avia Code Block but instead:
    – put all the HTML in simple Text block
    – and the call to the JS in a code block

    Adjust also the path to @font-face according to your child theme path

    Hope it helps

    EDIT :
    Forgot that you will also have to change the JS code according with the new classe name:

    CBPFWTabs.prototype._init = function() {
    		// tabs elemes
    		this.tabs = [].slice.call( this.el.querySelectorAll( 'nav > ul > li' ) );
    

    by

    CBPFWTabs.prototype._init = function() {
    		// tabs elemes
    		this.YourClasstabs = [].slice.call( this.el.querySelectorAll( 'nav > ul > li' ) );
    

    a lot of works… :-(

    #602610

    @pako69 – Extremely grateful for your response. I’m a bit closer, but it’s still not looking anywhere near the demo. Here is what I did.

    1. CSS – Did a find (.content) and replace (.full-width-content)
    2. CSS – Did a find (.tabs) and replace (.full-width-tabs)
    3. CSS – Pasted new CSS into Enfold Quick CSS
    4. JS – I followed your “EDIT” by doing a find (this.tabs) and replace (this.full-width-tabs) on the cbpFWTabs.js file
    5. JS – Called the JS by adding the following to a Code Block

    <script src=”js/cbpFWTabs.js”></script>
    <script>
    new CBPFWTabs( document.getElementById( ‘tabs’ ) );
    </script>

    6. HTML – Added to a simple Text block

    I’m not sure how to do “Adjust also the path to @font-face according to your child theme path”, but I’ll keeping trying to figure it out. Guessing I need to download a font pack.? If so, not sure where it goes. /themes/enfold-child/fonts ???

    Regardless of the @font-face issue, the tabs are not taking shape at all.

    Maybe I haven’t done enough with functions.php. Here is what I have.

    function ava_custom_script() {
    wp_enqueue_script( ‘my-custom-script’, get_stylesheet_directory_uri().’/js/cbpFWTabs.js‘, array(‘jquery’), 2, true );
    }
    add_action( ‘init’, ‘ava_custom_script’, 100 );

    Thanks again,
    Ryan

    #603172

    Hi
    This:
    <script src=”js/cbpFWTabs.js”></script>
    Will not work as your are trying a JS file from a relative path…

    Guessing I need to download a font pack.?
    > Donwload the demo of this and you will get all the fonts, you have to place them into you child theme, in a new folder like /font and so change the path to call them into your CSS file where @font-face delcaration must be present.

    #603204

    I’m testing this locally, so I would think the relative path method is fine? I have the JS file at the following path and it’s not working.
    \htdocs\wordpress\wp-content\themes\enfold-child\js\cbpFWTabs.js

    Downloaded the demo. Here is what I have and it’s also not working.
    \htdocs\wordpress\wp-content\themes\enfold-child\fonts\icomoon

    Here is a snippet of what I have in Quick CSS.
    @font-face {
    font-family: ‘icomoon’;
    src:url(‘../fonts/icomoon/icomoon.eot?pvm5gj’);
    src:url(‘../fonts/icomoon/icomoon.eot?#iefixpvm5gj’) format(’embedded-opentype’),
    url(‘../fonts/icomoon/icomoon.woff?pvm5gj’) format(‘woff’),
    url(‘../fonts/icomoon/icomoon.ttf?pvm5gj’) format(‘truetype’),
    url(‘../fonts/icomoon/icomoon.svg?pvm5gj#icomoon’) format(‘svg’);
    font-weight: normal;
    font-style: normal;
    } /* Icons created with icomoon.io/app */

    #603219

    I’m testing this locally, so I would think the relative path method is fine?
    No… suppose your website URL is http://www.mycompany.com and the test page is at http://www.mycompany.com and if you leave:
    <script src=”js/cbpFWTabs.js”></script>
    It’s like you trying a JS file located at http://www.mycompany.com/js/cbpFWTabs.js which is wrong…

    Same for the path of you CSS they are wrong… If you child style.css is located at \htdocs\wordpress\wp-content\themes\enfold-child\ and you write:
    src:url(‘../fonts/icomoon/icomoon.eot?pvm5gj’);
    Your are trying yo call something located at \htdocs\wordpress\wp-content\themes\
    the ../ means: go back

    #603312

    Thanks. Think I’m just going to give up on this. It doesn’t matter what path I put in…it doesn’t work. I’ve tried Relative Paths and Absolute Paths. I’ve tried online dev and local dev.

    The message board knows the locations of what I’m trying to call. If someone can tell me the EXACT PATH…great. Frustrated.

    \htdocs\wordpress\wp-content\themes\enfold-child\fonts\icomoon
    \htdocs\wordpress\wp-content\themes\enfold-child\js\cbpFWTabs.js

    #603332

    “I’m just going to give up on this”
    Yes, I agree with you…

    “If someone can tell me the EXACT PATH”
    I’m afraid you request it out the scope of Enfold support team as is it not all an Enfold feature and not a WordPress plugin…

    Why don’t you use Enfold Tabs?

    #603340

    Yes, I’m well aware of the policy. However, I have helped people on here, when I’m not paid to do so and when it’s not specifically an Enfold/WordPress issue. It’s called community and it’s called paying it forward. While some are stronger in some areas, others are stronger in their respective areas.

    This makes me not want to help anyone on here. Sad.

    #603341

    I’ve done my best, sorry…

    #603872

    Hi!


    @pako69
    we really appreciate your help!


    @rlogan2334
    we understand your position… This is out of our support scope and the best we can do in this situation is to point you to some helpful resources. The learning curve is something that test every one and you just need to keep trying to learn what you want :)

    This is an old link but it will give you a fair idea how it is done
    https://www.smashingmagazine.com/2011/10/create-tabs-wordpress-settings-pages/

    There are many other tutorials which you might find it easy you can find it on google and also search on sites like https://stackoverflow.com

    Best regards,
    Vinay

    • This reply was modified 8 years, 9 months ago by Vinay.
    #603955

    Thanks. This is not just about “Tabs”. This is about numerous features (e.g. tabs, hover effects, whatever) that I run across daily, that provide packed HTML, CSS and JS that can be added to a WordPress implementation.

    Following this post, I believe that the hard part has been answered and it’s just a path issue. To me, it sounds like someone is not willing/able to just tell me what the path is. I’ve given the exact details of what I’ve done so far. That’s whats disappointing.

    My strength is design but I’m obviously trying to learn. Otherwise, I would have just asked an open-ended question like “How do I add this HTML, CSS and JS?”. If people are trying…you help…at least that’s how I help people…even if it’s not “policy”.

    Thank you,
    Ryan

    #604107

    Hi!

    as written in our support policy we can provide you basic support related to the theme only. Basically things which are not working as expected are included in this. For something which you need to do we recommend to hire a freelance developer.

    Best regards,
    Andy

Viewing 21 posts - 1 through 21 (of 21 total)
  • The topic ‘HTML, CSS & JavaScript – What am I missing?’ is closed to new replies.