Struggling with Compatibility Issues Between LESS and Twitter Bootstrap

Currently, I am in the process of building a complex WordPress website using the 320press Twitter Bootstrap theme and incorporating LESS CSS.

Here are some key details to keep in mind:

  • WordPress 3.5
  • Bootstrap 2.0
  • LESS 1.3.3

Everything seems to be functioning smoothly on the WordPress and Bootstrap fronts. However, getting LESS to cooperate proved to be quite challenging. After downloading the less-1.3.3-min.js file from lesscss.org and placing it in the appropriate folder, I referenced it in the header.php file. Upon inspecting the page source, clicking on the less-1.3.3.js reference revealed that it loaded correctly.

This is what the relevant section of code looks like in my header.php file:

<link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/library/css/fonts.css">


<link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/library/css/custom.css">


<link rel="stylesheet/less" type="text/css" href="<?php echo get_template_directory_uri(); ?>/library/less/bootstrap.less">


<link rel="stylesheet/less" type="text/css" href="<?php echo get_template_directory_uri(); ?>/library/less/responsive.less">


<script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/library/js/less-1.3.3-min.js"></script>

Following the instructions on the LESS website, I loaded the script after the CSS files with high hopes for success. Nevertheless, nothing seemed to change. Frustrated by this setback, I experimented extensively but could not find a solution.

<-- When LESS refuses to cooperate -->

Eventually, I stumbled upon the standard "less-1.3.3.js" file on GIT and upon implementation, everything functioned flawlessly.

<-- desired outcome (the word "Readers")

Celebration was short-lived as I encountered a significant gap beneath the navigation bar when resizing the browser to 979px or below.

The expected appearance should resemble this:

Suspecting a CSS error on my part, I dedicated approximately four hours to investigate, only to realize that the compiled Bootstrap.css file was being displayed twice – once as a linked stylesheet:

and then again as an embedded stylesheet.

Using the Web Developer Extension in Firefox, I removed all embedded styles, restoring the site to its optimal presentation. However, I remain perplexed about what is causing this duplication in the site head other than potentially originating from the JavaScript. Is this a common occurrence amongst developers?

Any insights would be greatly appreciated. Unfortunately, due to working within an internal network environment, sharing a URL is not feasible at this time. To aid in visualizing the issue, I have included a few screenshots.

Please assist me! My attempts to troubleshoot this dilemma have left me feeling mentally drained.

Thank you.

Answer №1

Big shoutout to Scott Simpson for pointing me in the right direction on this one. I spent ages searching everywhere except the functions.php file, which turned out to be my main problem.

After commenting out the responsive.css section in the funcitons.php file, the issue was resolved. It always seems to be something simple in the end.

Once again, thank you!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

I am looking to bring in just the tables from a different html/php page

I am currently working on a webpage that includes a php library, header, and other elements. I only need to import specific tables and information from this page onto another screen display, with the tables arranged side by side instead of vertically. My ...

Designing Post Archive with Flexbox to create dynamic layouts

I am currently exploring different techniques to style my columns, and I have encountered an issue where if there are less than 4 posts in a row, there is extra space between each post. While I understand that floats can resolve this problem, I am searchin ...

Choosing a specific category to display in a list format with a load more button for easier navigation

Things were supposed to be straightforward, but unexpected behaviors are popping up all over the place! I have a structured list like this XHTML <ul class = "query-list"> <li class="query"> something </li> <li class="query" ...

What is the best way to limit the number of options displayed in the vue-multiselect

I'm looking to truncate multiple values on the vue-multiselect component. I attempted to override various classes without success, as shown in this example: .multiselect__content-wrapper { overflow-x: hidden; text-overflow: ellipsis; } ...

Adjust the background of a CSS element using jQuery as the y-axis scroll crosses a specific threshold

Once the user has scrolled 600px down the page, I want a CSS background image to transition from no image to a specific background image (image 1). However, if they scroll above 600px, I want it to switch to another image (image 2). It should be able to co ...

Is there a way to select the webkit-datetime-edit-year-field of Google Chrome in a disabled input using CSS?

I have a CSS class defined in my module.css file that alters the color of yyyy when an input is in range: .field input[type='date']:in-range::-webkit-datetime-edit-year-field { color: transparent; } This styling works as expected when the inpu ...

Utilizing CSS nested spans and setting custom width attributes

I'm curious about how nested spans and CSS handle the width attribute. In the HTML code provided, the 'wide' class sets the width while the 'box' class adds a border. I've noticed that the width is only applied when both class ...

Can you tell me the name of the unique animated style featured on the new iMac Pro page?

Is it possible to replicate the animation seen on the Apple iMac Pro page using only HTML5 and CSS3? What is this particular type of animation called? Visit the Apple iMac Pro page for reference. ...

Using CSS to align horizontally the legend of keys and values

I'm currently working on designing a horizontal legend using html/css. The design consists of colored boxes with text beside them, followed by some spacing, then another colored box with more text, and repeating in this pattern. [blue] - LabelA [g ...

Trouble with displaying vertical scroll bar in React app when height is set to 100%

I am developing a React application where I need the content to always occupy at least 100% of the height to style the background accordingly. I have attempted to achieve this by setting the CSS height to 100% at the top level, which works fine. However, t ...

Ensure that the second card occupies the entire column using Bootstrap 5

If I have a row with 2 columns, how can I ensure that the second card in a column fills the remaining space in the column? I attempted to use classes like flex-fill and flex-grow-1, but they did not seem to have any effect. Feel free to check out my code ...

Tips for customizing styles when an element is being dragged over in Material-UI?

If I want to alter the backgroundColor when hovering, I can utilize sx={{"&:hover":{backgroundColor:"yellow"}} Is there a way to adjust the backgroundColor on dragover? It appears that sx={{"&:dragOver":{backgroundCol ...

Inheritance in SASS - excluding the parent class

Can I apply this syntax to inherit a class in SASS? Code .message { border: 1px solid #ccc; padding: 10px; color: #333; } .success { @extend .message; border-color: green; } Output .message, .success, .error, .warning { border: 1px solid # ...

What is the best way to design a content page with linked boxes to various arrays in PHP?

How can I create a PHP menu template that navigates to different pages? I am new to PHP and still learning. I want to achieve something similar to this image: https://i.stack.imgur.com/ylfe8.jpg I have the code for the navigation bar, but I need help crea ...

Tips on utilizing a local file as a background image URL

How can I modify my CSS to link to a local file path like C:\xampp\htdocs\Folder instead of the URL https://source.unsplash.com/1600x1050/?nature. I am currently using Bootstrap 4 and below is my CSS code: .jumbotron{ background: ...

Adding external CSS to HTML can be easily achieved by using the link tag

After using inline and imported CSS loads without any issues, I am now facing difficulties with external CSS which I have never used before. I decided to copy and paste everything from this provided CSS link into a separate CSS file. However, I have yet t ...

Disabling pointer events using `pointer-events: none` may not function as expected on mobile

As I work on developing a custom drag and drop module for Vue, I encountered an issue. In order to override the default browser Drag and Drop behavior, I have implemented logic to clone the div element that needs to be dragged on pointer down event. Subseq ...

Bootstrap slider aligned to the right side

I'm currently utilizing bootstrap 3 for my website. However, I encountered an issue with the slider when viewing the page on a mobile device as the image was displaying outside the viewport, shifted to the right. Additionally, in Firefox, the slider ...

What is the best way to center a navbar vertically inside a div?

I've come across some posts mentioning the need for a container with h-100 to align items using the align-self class. However, I'm facing issues aligning a navbar at the bottom of a div. When I place the navbar within another container and row, i ...

How can you seamlessly pause a CSS3 animation in the middle of its execution?

I'm encountering a minor issue while trying to gracefully stop an animation mid-execution and smoothly return to the default state. The situation involves applying an animation to a child element using the :hover pseudo-class on its parent element. Ho ...