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 ...
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 ...
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 ...
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')...
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 ...
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-...
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 ...
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 ...
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['...
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 ...
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 ...
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) {
...
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 ...
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 ...
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 ...
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:
&...
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:...
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 ...
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']-&...
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 ...
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 ...
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 ...
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,
'...
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 ...
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 ...
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-...
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:
...
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' ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
twitter-bootstrap × 340css × 50
menus × 48
theme-development × 42
php × 38
jquery × 32
loop × 29
navigation × 22
themes × 19
functions × 16
html × 16
plugin-development × 14
walker × 14
widgets × 13
wp-enqueue-script × 13
custom-post-types × 12
wp-query × 12
images × 12
javascript × 12
plugins × 11
posts × 11
responsive × 11
shortcode × 10
child-theme × 9
wp-enqueue-style × 9