How to en-queue bootstrap 4 to theme?

You can use action hook and enqueue script and style to the site. function my_scripts() { wp_enqueue_style(‘bootstrap4’, ‘https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css’); wp_enqueue_script( ‘boot1′,’https://code.jquery.com/jquery-3.3.1.slim.min.js’, array( ‘jquery’ ),”,true ); wp_enqueue_script( ‘boot2′,’https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js’, array( ‘jquery’ ),”,true ); wp_enqueue_script( ‘boot3′,’https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js’, array( ‘jquery’ ),”,true ); } add_action( ‘wp_enqueue_scripts’, ‘my_scripts’ ); If you want to add the scripts after jQuery then you can use the … Read more

adding some custom html code to the wp_nav_menu function

To add that last list item, you don’t need a custom Walker. There is a hook that will allow you to tack that on. function add_last_nav_item($items) { return $items .= ‘<li><a href=”#myModal” role=”button” data-toggle=”modal”>Contact</a></li>’; } add_filter(‘wp_nav_menu_items’,’add_last_nav_item’); It wouldn’t be start_el and end_el that you’d need to edit anyway. Those generate the individual list items. It … Read more

Display custom post type and custom fields within a Bootstrap Carousel

I’ve found that for things like this, get_posts is easier. <?php // Set up your arguments array to include your post type, // order, posts per page, etc. $args = array( ‘post_type’ => ‘testimonial’, ‘posts_per_page’ => 3, ‘orderby’ => ‘date’, ‘order’ => ‘DESC’ ); // Get the posts $testimonials = get_posts($args); // Loop through all … Read more

How to modify an image block in Gutenberg WordPress 5?

After some digging and trial/error I have came up with a couple solutions. I was looking for a “Gutenberg” solution so I could avoid using str_replace. First, we need to enqueue our JS and include the wp.blocks package // Add to functions.php function gutenberg_enqueue() { wp_enqueue_script( ‘myguten-script’, // get_template_directory_uri() . ‘/js/gutenberg.js’, // For Parent Themes … Read more

Best way to include Bootstrap in WordPress

You can add bootstrap in WordPress by following function in functions.php You can change url as you need if you have cdn. <?php /** * Enqueue scripts and styles */ function your_theme_enqueue_scripts() { // all styles wp_enqueue_style( ‘bootstrap’, get_stylesheet_directory_uri() . ‘/css/bootstrap.css’, array(), 20141119 ); wp_enqueue_style( ‘theme-style’, get_stylesheet_directory_uri() . ‘/css/style.css’, array(), 20141119 ); // all scripts … Read more

WordPress Admin Bar Overlapping Twitter Bootstrap Navigation [closed]

How to prevent the WordPress admin bar from overlapping with your Twitter Bootstrap navigation bar. In response to: WordPress admin bar overlapping twitter bootstrap navigation Asked by: @TheWebs If you are using Twitter Bootstrap with WordPress and have an issue with the WordPress admin bar overlapping with your navigation bar, you’re probably pretty frustrated with … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)