Skip to main content
16 votes
Accepted

How to modify Contact Form 7 Success/Error Response Output

After taking a deeper look in to this, I realised that the responses that are displayed are produced via the Contact Form 7 AJAX. So, following the Contact Form 7 documentation on DOM Events, I was ...
Mat's user avatar
  • 1,637
10 votes
Accepted

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 ...
Punitkumar Patel's user avatar
8 votes

Main menu not appearing on category pages

I know this question is quite old but since there is no answer yet an there are many similar questions on the WordPress support forums, I'll better share my findings and maybe help someone. The issue ...
AndyDeGroo's user avatar
7 votes
Accepted

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')...
Akshat's user avatar
  • 1,197
5 votes
Accepted

What is the problem if I use CDN in my WordPress parent theme(built using bootstrap)?

Your theme should not depends on any external link library. There is no guarantee when that library can be taken down. That's the reason all of your theme assets should be package with theme, to ...
daniyalahmad's user avatar
5 votes
Accepted

Style.css in child theme is loaded before Bootstrap

Mostly the parent theme might be enqueing the child theme's style.css, if so you can dequeue it by using handle and then enqueue with proper dependency. If the child theme's handle is child-theme-...
bravokeyl's user avatar
  • 3,369
5 votes

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 ...
RiddleMeThis's user avatar
  • 3,777
4 votes

Wordpress style.css not updating, only after theme reload

The proper way to add a style, as in a template or in a theme, is to use the wp_enqueue_style function. See https://developer.wordpress.org/reference/functions/wp_enqueue_style/ . One of the ...
Rick Hellewell's user avatar
4 votes

How to modify an image block in Gutenberg WordPress 5?

Use the render_block filter hook: add_filter( 'render_block', 'wrap_my_gallery_block', 10, 2 ); function wrap_my_gallery_block( $block_content, $block ) { if ( 'core/gallery' !== $block['...
Alberto's user avatar
  • 41
3 votes

Style.css in child theme is loaded before Bootstrap

Good news. This is an easy fix. WordPress allows you to declare dependencies when registering scripts and stylesheets. Simply list the assets you wish to load earlier as dependencies for the later ...
jdm2112's user avatar
  • 3,686
3 votes
Accepted

wp_list_pages(); Change output of hyperlink

You could add a filter on post_type_link, which allows modification of custom post type permalinks before they are output. The filter passes the custom post object as the 2nd argument, so we can use ...
Milo's user avatar
  • 78.7k
3 votes

Nav walker, bootstrap: Display 3rd level items under 2nd level

I solved this problem. follow these instructions..... Add script (function($){ $(document).ready(function(){ $('ul.dropdown-menu [data-toggle=dropdown]').on('click', function(event) { ...
Md.Tauhidul Islam's user avatar
3 votes

Enqueue Child CSS to Load After Bootstrap CDN

Adding the dependency should work. You are not calling your theme styles file correctly though. You need to move your theme-style.css file down to the root folder of the theme itself and name it ...
Cedon's user avatar
  • 1,659
3 votes

Add Bootstrap dropdown class to a nav menu

The easiest way to do this is to use an off-the-shelf solution. There is a WP_Bootstrap_Navwalker class which extends WordPress' native Walker_Nav_Menu class and makes your Navigation Menus ready for ...
Max Yudin's user avatar
  • 6,338
3 votes

Best way to include Bootstrap in Wordpress

How about to save a bandwidth and possibly increase a page loading speed using MaxCDN and NetDNA. Add this two functions to your functions.php function pwwp_enqueue_my_scripts() { // jQuery is ...
Alexius The Coder's user avatar
3 votes
Accepted

HTML Bootstrap navigation menu to Wordpress menu using wp_nav_menu

You have to edit the files in: wordpress/wp-content/themes/twentyseventeen/template-parts/navigation/navigation-top.php and then create a custom walker, try to take a look here. Try in this way: &...
benny-ben's user avatar
  • 374
3 votes

How to modify an image block in Gutenberg WordPress 5?

The following answer is a solution for Bootstrap 4 and centering images in a <figure> tag. WordPress generated default: <figure class="wp-block-image"> <img src="http://localhost:...
user9447's user avatar
  • 1,782
3 votes
Accepted

Continue or break the while loop

'break' is the right keyword... code structure below, no custom query needed if used in a standard template. <?php $posts_per_first_section = 6; //how many posts you want to show in ...
Michael's user avatar
  • 8,399
3 votes
Accepted

Customize "the_posts_pagination" and put list instead div

Making your Custom Pagination design In Demo According Your Need . below function Replace Your Function: function wp_custom_pagination($args = [], $class = 'pagination') { if ($GLOBALS['wp_query']-&...
HK89's user avatar
  • 706
2 votes

Why isn't "background-image: url"working with Bootstrap carousel on WP?

What if you use: <div class="fill" style="background-image: url(<?php echo get_stylesheet_directory_uri();?>/img/image01.png);"></div> You need to tell WordPress in "a ...
user101738's user avatar
2 votes

Main Menu and Sub Menu Items for Footer

This is actually not that difficult if you already know how the walker class works. You would need two calls to wp_nav_menu. The first one you have should already work, because the function natively ...
cjbj's user avatar
  • 14.8k
2 votes
Accepted

Output the aria-labelledby parameter for a nav menu child

I solved it. I thought it could work but i wasn't sure, and i wanted some opinion from more experienced people. Anyways, this is what i have done: First of all, i defined a private var in my walker ...
Daniele Squalo's user avatar
2 votes

How to create bootstrap grid loop?

Okay I got it! And this code works perfectly for me. :) <?php $args=array( 'post_type' => 'post', 'posts_per_page' => 4, '...
The Lee's user avatar
  • 21
2 votes

What is the problem if I use CDN in my WordPress parent theme(built using bootstrap)?

As daniyalahmad said, it is better not to include links to external assets in your theme. A good example of this recently. I use a theme from MyThemeShop and they linked to external html5shim. Google ...
Brian Jackson's user avatar
2 votes

Grid post page on Wordpress with Bootstrap, the_excerpt(); Problem

The way I tackle this issue is by closing the row every nth column, like so. You basically collect the total number of posts in the current loop then at the end of each loop, increment $i and check ...
Kieran McClung's user avatar
2 votes
Accepted

Enqueuing latest version of jQuery into a child theme returns a blank screen

It does look like some compatability issues are present. There is an answer to a very similar situation on stack exchange here: https://stackoverflow.com/questions/37738732/jquery-3-0-url-indexof-...
Chris Stage's user avatar
2 votes

I have problems with loading javascripts

You seem to be loading both file/folder names into the queue. get_template_directory_uri() . 'http://fitclaw.com/wp-content/themes/Coming%20Soon/js/jquery.js should only be: ...
socki03's user avatar
  • 1,952
2 votes
Accepted

NavWalker Bootstrap Error (won't dropdown)

Wrong container_id and menu_class. See WP Bootstrap NavWalker Usage section. <?php wp_nav_menu( array( 'theme_location' => 'primary', 'depth' => 2, 'container' ...
Max Yudin's user avatar
  • 6,338
2 votes
Accepted

Bootstrap accordion looping through posts incorrectly

Your problem is that you're using the_ID() to give an ID to each taxonomy term, but the_ID() doesn't output the ID of the current term in a foreach loop, it get's the ID of the current post. Since ...
Jacob Peattie's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible