WordPress Loop with Custom Post Type for Bootstrap Accordion [closed]

You put the accordion inside the loop, that’s why it is not working as you want. Try this: <?php $args = array( ‘post_type’ => ‘review’ ); $the_query = new WP_Query($args); ?> <div class=”row mb-5″> <div class=”col-md-9″> <div id=”accordion” role=”tablist” aria-multiselectable=”true”> <?php if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : ?> <?php $the_query->the_post(); ?> … Read more

Bootstrap isn’t called into my WordPress theme

Put this code in functions.php file and check it. function theme_add_bootstrap() { wp_enqueue_style( ‘bootstrap-css’, get_template_directory_uri() . ‘/bootstrap/css/bootstrap.min.css’ ); wp_enqueue_style( ‘style-css’, get_template_directory_uri() . ‘/style.css’ ); wp_enqueue_script( ‘bootstrap-js’, get_template_directory_uri() . ‘/bootstrap/js/bootstrap.min.js’, array( ‘jquery’ ), ‘3.0.0’, true ); } add_action( ‘wp_enqueue_scripts’, ‘theme_add_bootstrap’ );

ACF | WooCommerce | Theme Development | How to include a /template-part/ that makes use of ACF’s on a custom WooCommerce homepage?

You cannot include template files via URL, which is what get_template_directory_uri() returns. You need to use the server file path, which you get get with get_theme_file_path(): $heroslider = get_theme_file_path( ‘template-parts/hero-slider.php’ ); echo $heroslider; include_once( $heroslider ); However, if you’re including templates (rather than files with function/class definitions), you should use get_template_part() to get the correct … Read more

How to save the Additional CSS in a CSS file and enqueue it

add_action(‘customize_register’, ‘theme_footer_customizer’); function theme_footer_customizer($wp_customize){ // Get upload directory $upload_dir = wp_get_upload_dir(); // Create style file path $style_file_path = sprintf( ‘%1$s/css’, untrailingslashit( $upload_dir[‘basedir’] ) ); // Create directories if they do not exist if( ! file_exists( $style_file_path ) ) { wp_mkdir_p( $style_file_path ); } // Sanitize contents ( probably needs to be sanitized better, maybe with … Read more