Created
May 15, 2023 10:14
-
-
Save bulbul84/f2a8cd15fe0761da9e04f8d82e042348 to your computer and use it in GitHub Desktop.
How to add URL parameter to wordpress site for hide some section
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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