It’s not showing because the .insertAfter()
and .show()
functions are called on resize events only, while mobile devices do not resize. They already load the page with their mobile sized. Just make sure you also run the code on the ready event:
<script type="text/javascript">
/* to show back the left side bar back when the LEFT side bar is moved next/below to the center/content */
function responsive_sidebar() {
if ( jQuery(window).width() < 1018 ) {
jQuery('.tm_left').insertAfter(".tm_center");
jQuery('.tm_left').show();
} else {
jQuery('.tm_left').insertBefore(".tm_center");
}
}
jQuery(document).ready(function() {
responsive_sidebar();
$(window).resize( responsive_sidebar );
});
</script>
Note that I put the code into a function, just so you have fewer lines of code/
Related Posts:
- How to integrate my HTML and javascript into my child theme
- Could the WP script/style loader be used to concatenate and gzip scripts and styles in the front-end?
- Child themes CSS priority problems without using !important
- wp_enqueue_scripts, wp_register_scripts, wp_print_scripts: i’m confused
- How do I remove specific styles from the parent theme css using the child theme css?
- How to combine multiple CSS files and concatenate JavaScripts if WordPress recommends enqueuing them?
- How to solve ‘Eliminate render-blocking JavaScript and CSS in above-the-fold’ content for multiple files?
- WordPress Displaying Thumbnails Vertically
- Do I only need to import style.css for a child theme?
- Trying to load a responsive CSS media query using Custom Taxonmy
- How Can I Use A Child Theme Effectively When Parent’s CSS Is Located in a ‘CSS folder’?
- How can I make new .css file in child theme override styles in child theme’s style.css
- Disable child theme css on certain pages
- some things in child theme css not overriding parent
- Why do WordPress default themes specify fonts in so many places?
- CSS in child theme not getting loaded
- TwentyTwelve versioning
- Changing Font-Size based on specific Font thru javascript
- How to change Parent Themes in Child Theme CSS
- Duplicate and alter sidebar for Twenty Eleven
- Collapsible button inside a ul list does work in jsfiddle but not in WP
- How can I remove css from a child theme?
- Relative path instead of absolute for wp_enqueue_script
- Handling URLs in WordPress application
- Can “ and “ tags be used in the HTML editor?
- Is it better to put CSS in additional CSS or in Child theme styles.css [closed]
- JavaScript added as link/stylesheet
- Write text below a specific part of a sentence
- What controls responsiveness in WordPress?
- WordPress on localhost working, when sharing IP to connect receive err_connection_refused on .js and .css files
- Font Awesome wp_enqueue_style
- Show enqueued CSS and Script in custom header
- How to insert html/css/javascript code to wordpress plugin
- Eliminate render-blocking JavaScript and CSS in above-the-fold content
- Different ways to load child theme css
- WordPress Twenty Fourteen Theme Sidebar
- Importing changes to Child Theme
- Load in wp admin assets from child theme
- Help with child theme enqueuing additional css files
- Older isotope portfolio rows shifting downward by 1 pixel on hover
- Shrink Header Image on Scroll
- How to create fa-bars animated menu
- Does costum code in the root folder get lost when wordpress is updated?
- Why does my caroussel gallery do this in responsive? [CSS] [closed]
- Twenty fifteen theme – change responsive menu condition
- @media in bluehost is being commented out [closed]
- CSS Minification
- Responsive Images Warping
- Old Site displays on Mobile View, not New Site
- why this media query is not working / not loading when I put it in child theme?
- No responsive design is displayed
- Trying to figure out why my child theme is trying to access a file that doesn’t exist
- Child theme CSS not applying to element
- Correct Way To Make Changes To A WordPress Theme
- Title has word broken when viewed in mobile [closed]
- Child theme stylesheet not always overriding “index”
- Move Sidebar from Above Content To Below When Responsive [closed]
- Seperate functions.php for part of site
- How can I get the search form to be selected automatically?
- Implementing a simple slider in code?
- Cannot set property ‘className’ of null at setThemeFromCookie
- Child Theme CSS not showing at all
- Faster fonts on mobile
- How to change “““ to “““?
- Why is my child theme style.css not found (404) in the front-end? [closed]
- Change Header Image on Blog Post for Mobile View
- How to sync the style in the visual editor with the style of a child theme?
- Conditionally enqueue a stylesheet based off of a javascript click event
- Remove CSS Attribute by Overriding CSS in Child Theme
- get_template_directory_uri() generates wrong path
- Menu toggle bar works only on some pages in WordPress
- Remove CSS & JS from
- CSS getting injected into index from somewhere after theme/custom CSS is loaded, overriding all of my CSS [closed]
- enqueing Javascript and CSS
- child theme appears again when I put the header with parent name.
- How to Add a Read-only Textbox With Text in it That Has a Button to Copy it?
- All of my custom Bootstrap styles are not working in my child theme!
- Earlier stylesheet not overriding later one
- ACF Pro with SlickJS [closed]
- Free theme and css/bootstrap.css is not overridden in the child theme
- Show/Hide Div for Login Mask
- prevent HTML output if custom field is empty [closed]
- Plugins not showing up for custom template
- Equal height sections in custom Headway Theme
- W3TotalCache and Javascript — what should go where, when?
- How would I create the same popup in css and javascript as the one in contact button on the site https://www.sublimotionibiza.com/es/main.html [closed]
- Combine CSS Files without plugin
- Child Theme style.css changes aren’t showing. Parent “style-less.css” over rides it, and won’t update
- Button doesn’t work in the profile panel
- WordPress Rest Api access the header and extract stylesheets URL
- Invert porfolio item order
- How to make a function to play only on the home page?
- Css will not display in webpage, after adding it in style.css in child theme
- Embed widget from external source (Zendesk)
- Hide Tab Titles from Tabs Block
- How can I hide this custom slider while Elementor editing window is open?
- Need to make sidebar responsive only when screen width is greater than 1024px
- broken internal JavaScript and CSS files
- How to enqueue stylesheets in child-theme functions.php?
- Dequeing Parent Fontawesome Deques Parent Styles