WordPress, WPLMS, Visual Composer and full width content

I am working on a new website for a customer and we are using the WPLMS (WordPress Learning Management System) as a foundation. The packaged theme is based on Bootstrap.

The theme provides its own page-builder, but we prefer to use Visual Composer, as we built some custom VC-Addons to ease future page updates for our customer and custom content integration. Visual Composer provides some nice full-width addons, which are not working with the current theme layout. I decided to use a custom page template to allow Visual Composer to take over, where needed :)

ADDING A NEW PAGE TEMPLATE

New page template: page-vc-template.php

  1. <?php
  2. /*
  3. Template Name: Visual Composer
  4. */
  5. /* portalZINE NMN - www.portalzine.de */
  6. get_header();
  7.  
  8. if ( have_posts() ) : while ( have_posts() ) : the_post();
  9.  
  10. $title=get_post_meta(get_the_ID(),'vibe_title',true);
  11. if(vibe_validate($title)){
  12. ?>
  13. <section id="title">
  14.   <div class="container">
  15.     <div class="row">
  16.       <div class="col-md-9 col-sm-8">
  17.         <div class="pagetitle">
  18.           <h1>
  19.             <?php the_title(); ?>
  20.           </h1>
  21.           <?php the_sub_title(); ?>
  22.         </div>
  23.       </div>
  24.       <div class="col-md-3 col-sm-4">
  25.         <?php
  26.                     $breadcrumbs=get_post_meta(get_the_ID(),'vibe_breadcrumbs',true);
  27.                     if(vibe_validate($breadcrumbs))
  28.                         vibe_breadcrumbs();
  29.                 ?>
  30.       </div>
  31.     </div>
  32.   </div>
  33. </section>
  34. <?php
  35. }
  36.  
  37.     $v_add_content = get_post_meta( $post->ID, '_add_content', true );
  38.   
  39. ?>
  40. <section id="content" class="vc-template">
  41.   <div class="inner">
  42. <?php
  43.  the_content();
  44. ?>
  45.   </div>
  46. </section>
  47. <?php
  48. endwhile;
  49. endif;
  50. ?>
  51. </div>
  52. <div class="vc-template">
  53. <?php
  54. get_footer();
  55. ?>
  56. </div>
  57.  

Copy this to your WPLMS theme directory and select the template on page setup. I added an inner wrapper for the content to allow some options for media queries and for the footer, to kill any top margin.

MORE TWEAKS

You can even tweak this by adding a custom field. Allowing you to do some nice css switching :) and allowing you to go past the max width for the inner content.

  1. $v_add_content = get_post_meta( $post->ID, '_add_content', true );
  2. $pz_fullpage = get_post_meta(get_the_ID(),'pz_fullpage',true);
  3. ?>
  4. <section id="content" class="vc-template <?php echo $pz_fullpage ;?>">
  5.   <div class="inner">
  6. <?php
  7.  the_content();
  8. ?>
  9.   </div>
  10. </section>

 

ADDING SOME STYLE

Here some styles to enable the media queries again. Just add those to your main style.css or the  Visual Composer style popup, on the page you are editing.

  1. section#content.vc,
  2. section.vc#title{padding-top:82px;}
  3.  
  4. .vc-template .inner .vc_row{max-width:1080px;margin-left: auto;margin-right: auto;}
  5.  
  6. @media (min-width: 768px) {
  7.  .vc-template .inner .vc_row{max-width:750px!important;margin-left: auto!important;margin-right: auto!important;}
  8. }
  9. @media (min-width: 992px) {
  10.  .vc-template .inner .vc_row{max-width:970px!important;margin-left: auto!important;margin-right: auto!important;}
  11. }
  12. @media (min-width: 1200px) {
  13.  .vc-template .inner .vc_row{max-width:1180px!important;margin-left: auto!important;margin-right: auto!important;}
  14. }
  15. .vc-template footer{margin-top:0!important}

The first style pushes the content down, so that its not hidden below the transparent header. Still tweaking this, but works nicely so far. This also allows me to use other full-width addons again, like Vc_Row Background Pro :)

ROUGH EXAMPLE :)

Cheers and enjoy
Alex

RELATED LINKS

Alex

I am a full-stack developer. I love programming,  design and know my way around server architecture as well.  I would never feel complete, with one of these missing. I have a broad range of interests, that’s why I constantly dive into new technologies and expand my knowledge where ever required. Technologies are evolving fast and I enjoy using the latest. Apart from that, I am a peace loving guy who tries to have people around him that think the same.  I truly believe in the principle: “If you help someone, someone will help you, when you need it."

Recent Posts

B&B / Hotel Booking Solutions for WordPress | 2024

BOOKING SOLUTIONS 202x This is my take on a subset of booking, appointment, PMS or… Read More

4 weeks ago

WordPress Cron + WP-CLI + Ntfy

THE GOAL Create a system cron for WordPress, that is accessible and can be easily… Read More

2 months ago

2024 is here and now :)

2024, what's cooking? Slowly getting into the 2024 spirit. 3 projects coming to a close… Read More

4 months ago

2023 ends and whats next !

Short look back at 2023 This has been a busy and interesting year. I am… Read More

4 months ago

cubicFUSION Grid Tweaker – Elementor Grid made easy.

Elementor Pro provides grid containers as an experimental feature. The options provided are limited, when… Read More

5 months ago

Archaeology Travel Booth – Travel Innovation Summit 2023

Archaeology Travel is an online travel guide for people who enjoy exploring the world’s pasts.… Read More

6 months ago