Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 9 of 9
Like Tree4Likes
  • 1 Post By mlseim
  • 1 Post By mlseim
  • 1 Post By mlseim
  • 1 Post By mlseim

Thread: What is wrong with this code, that I put in my child theme files, then in code editor

  1. #1
    Senior Member
    Join Date
    Nov 2012
    Posts
    111
    Member #
    33949
    Liked
    2 times

    What is wrong with this code, that I put in my child theme files, then in code editor

    Hi, can anybody guide me on where I have gone wrong with this code in trying to put an animation in a child theme.
    I created animate.css file which I put in a folder named css.
    I created functions.php file.
    These go in twentythirteen-child folder
    I put classes code in the wordpress code editor

    Here is the code I put in the animate.css file:

    @keyframes slideInRight {
    from {
    -webkit-transform: translate3d(100%, 0, 0);
    transform: translate3d(100%, 0, 0);
    visibility: visible;
    }
    to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    }
    }
    .slideInRight {
    -webkit-animation-name: slideInRight;
    animation-name: slideInRight;
    }


    Here is the code I put in functions.php:

    add_action( 'wp_enqueue_scripts', 'wpb_animate_styles' );
    function wpb_animate_styles() {
    wp_enqueue_style( 'animate-css', get_stylesheet_directory_uri() . '/css/animate.css', '3.5.0', 'all');
    }

    and here is the code in the code editor on the wordpress page:

    <!-- wp:image {"id":13,"className":"wp-block-image/animated slideInRight"} -->
    <figure class="wp-block-image/animated slideInRight"><img src="http://spencerart.local/wp-content/uploads/2021/05/tree1.jpg" alt="" class="wp-image-13"/></figure>
    <!-- /wp:image -->

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,967
    Member #
    5580
    Liked
    758 times
    I just found this, but it's from 2013.

    3 Ways to Animate WordPress (wpmudev.com)

    Not sure how current it is.
    But you're using a local server ... that's the part that I have no experience with.

    Don't worry about the child theme stuff ... do their tutorial as they describe.
    It appears they are modifying the actual theme files, which is OK at this point.
    spencer likes this.


  4. #3
    Senior Member
    Join Date
    Nov 2012
    Posts
    111
    Member #
    33949
    Liked
    2 times
    Thanks Mlseim for your effort. Unfortunately I did exactly what they say, but my animation won't work.
    I don't know how I am ever going to solve this problem, Looks like I need a webdeveloper friend or someone to show me exactly.

  5. #4
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,967
    Member #
    5580
    Liked
    758 times
    I think your biggest issue will be your local server w/configuration and setup.
    You're right in that you'll need someone with experience in that area.

    My experience is all online, with shared webhosts and their servers with PHP7 and SQL configured and setup for typical websites.

    I realize you want to do this all on your own with your own local server. Hats off to you for attempting it and learning tons of things along the way ... IT stuff like that never really interested me, so I never took time to learn things at that level. What is nice about using a cheap webhost is that I have access to everything from any computer in the world. I use my website for personal things like file and data storage with PHP, SQL, and not much wordpress, because I don't really like it. It's easy to quickly create a website, but the code is too bloated. I get frustrated too, just like you.

    I'm 60 years old, so I'm "old school" and don't really need extra stress in my life.
    spencer likes this.


  6. #5
    Senior Member
    Join Date
    Nov 2012
    Posts
    111
    Member #
    33949
    Liked
    2 times
    Oh, so you mean, that if I did a wordpress site online with a hosting company, I wouldn't need to worry about trying to get an animation in a child theme.
    How would you put an animation on the website then, would it be with a plugin.
    I want to do websites for profit, so I don't know if I can do that, if I just use plugins, or can I.

  7. #6
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,967
    Member #
    5580
    Liked
    758 times
    I'm thinking of plugins like this (but I've never tested it):
    https://wordpress.org/plugins/page-specific-scripts/

    But maybe your sites should not, or do not, need to be wordpress sites.

    Why are you wanting to use wordpress? Is that a requirement from a customer?
    What are the animations going to be all about?

    Remember that some people will be using your sites on a laptop, desktop, tablet, smartphone.
    Will those animations work on everything?
    spencer likes this.


  8. #7
    Senior Member
    Join Date
    Nov 2012
    Posts
    111
    Member #
    33949
    Liked
    2 times
    Thanks. What website CMS do you use. I don't want to learn bootsrap, as you cannot use php in it. Wordpress uses, javascript and php.
    Should I just design with a code editor like notepad. What do you think.

  9. #8
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,967
    Member #
    5580
    Liked
    758 times
    Bootstrap is just a JQuery (javascript) framework.
    You can use PHP with anything. PHP is processed "server side" so it can actually add/modify javascripting dynamically.
    PHP also allows AJAX, which is the combination of javascripting and PHP.

    But, in the end, you still need to know how to script with PHP/SQL/javascripting/JQuery/AJAX and Perl (if you go "old school").

    Something I've done in the past ... find a free website template (whether it's bootstrap or not), and then make it "alive" by adding PHP (forms processing, dynamic content, etc.)

    Everything you do really depends on the features required.

    Most companies (small businesses) these days don't even need or use a website. Maybe just a single page to give out phone number, address, and basic info. Otherwise they can just use Google business directory or some social media page to connect with customers. If they sell online they need a page, but otherwise ... why bother. If you mostly use a smartphone, how often do you navigate to "other pages" in a site? I don't. I just want a phone number, store hours, and address to get directions.
    Last edited by mlseim; May 25th, 2021 at 12:01 PM.
    spencer likes this.


  10. #9
    Senior Member
    Join Date
    Nov 2012
    Posts
    111
    Member #
    33949
    Liked
    2 times
    Oh no. Looks like I have missed the boat. Learning web design now, when they do not need sites anymore.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 09:33 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com