theme children
-
I’m starting in wordpress and I’ve created a child theme, I’m trying to add a modal but it does not work out, the steps I took were:
-Add the function.php in the subject-child<? php function enqueue_styles_child_theme () { $ parent_style = 'twentyseventeen-style'; $ child_style = 'twentyseventeen-child-style'; wp_enqueue_style ($ parent_style, get_template_directory_uri (). '/style.css'); wp_enqueue_style ($ child_style, get_stylesheet_directory_uri (). '/style.css', array ($ parent_style), wp_get_theme () -> get ('Version') ); wp_enqueue_style ($ child_style, 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css', array (), null, true ); } add_action ('wp_enqueue_scripts', 'enqueue_styles_child_theme'); function twentyseventeen_child_js () { wp_enqueue_script ('jQ', 'https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js', array (), null, true ); wp_enqueue_script ('bootstrap', 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js', array (), null, true ); } add_action ('wp_enqueue_scripts', 'twentyseventeen_child_js'); - Copy the footer to the child theme Include the modal file after <? php wp_footer (); ?> Like this: <! - Include modal -> <? php include 'modal.php'; ?>– create the file modal.php
<! - Modal -> <div class = "modal fade" id = "myModal" role = "dialog"> <div class = "modal-dialog"> <! - Modal content -> <div class = "modal-content"> <div class = "modal-header"> <button type = "button" class = "close" data-dismiss = "modal"> & times; </ button> <h4 class = "modal-title"> Modal Header </ h4> </ div> <div class = "modal-body"> <p> Some text in the modal. </ p> </ div> <div class = "modal-footer"> <button type = "button" class = "btn btn-default" data-dismiss = "modal"> Close </ button> </ div> </ div> </ div> </ div>– Finally add an entry with the button that the modal must call:
<! - Modal Bootstrap -> <button class = "btn btn-info btn-lg" type = "button" data-toggle = "modal" data-target = "# myModal"> Open Modal </ button>But does not it come out? What do you think I’m failing?
I have verified and upload the files of js and css. Any ideas?
The page I need help with: [log in to see the link]
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘theme children’ is closed to new replies.