Skip to content

Instantly share code, notes, and snippets.

@bulbul84
Created May 15, 2023 10:14
Show Gist options
  • Save bulbul84/f2a8cd15fe0761da9e04f8d82e042348 to your computer and use it in GitHub Desktop.
Save bulbul84/f2a8cd15fe0761da9e04f8d82e042348 to your computer and use it in GitHub Desktop.
How to add URL parameter to wordpress site for hide some section
(function ($) {
"use strict";
jQuery(document).ready(function($){
// For hiding section which is not needed at app
var headerSelector = "#masthead"; // header
var footerSelector = "#colophon"; // footer
var blogMenu = ".blog_menu_area"; // blogmenu
var blogSidebar = ".blog_sidebar"; // blog sidebar
var recentPost = ".featured_post_area"; // blog sidebar
var blogCta = ".cta_wrapper"; // blog cta
var blogPostComments = ".single_post_comments"; // blog post comment
var blogRating = "#wpd-post-rating"; // blog post comment
if(window.location.search.indexOf("app=true") !== -1) {
$(headerSelector).hide();
$(footerSelector).hide();
$(blogMenu).hide();
$(blogSidebar).hide();
$(recentPost).hide();
$(blogCta).hide();
$(blogPostComments).hide();
$(blogRating).hide();
}
});
}(jQuery));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment