Edit a function.php rule to hide a lightbox on a set of pages
- or -
Post a project like this$$
- Posted:
- Proposals: 8
- Remote
- #1947721
- Expired
PPH's No.1 - Wordpress|Magento|PHP| Responsive | PSD to responsive html | All Time Top Rated freelancer on PPH | 100% client satisfaction | Ecommerce | SEO
San Jose
Full Stack Web Developer with 13+ Years of Experience | Entrepreneur | Website Designer | Wordpres Developer | AI App Developer | Prompt Engineer | Python Programmer
Greater Noida
Web and Front-end Developer, Webmaster, Graphic Designer, UI/UX Designer, Wordpress Developer
Kalibo (poblacion)
136577418977947471010303671394989172845517724261800380
Description
Experience Level: Intermediate
A few years ago I had a freelancer write a rule to DISABLE the theme lightbox on pages that include 'cave' in the title.
This has worked so far, but now it doesn't any longer.
The mission of this job is to customise the rule to have it take action again. If you have a better way of doing it, that's allowed too.
--
Bonus info:
The theme has a setting to DISABLE or ENABLE the theme lightbox.
If enabled = much of my content bugs out
If disabled = my content works. But the pages including 'cave' now have two lightboxes showing. To prevent this I had the custom rule to disable it only on these pages, but this does no longer work, probably due to plugin and theme updates.
The theme is Enfold by Kriesi.at and the gallery that I'm using as well is NextGen
--
I'll pick the best bid today as it's quite urgent. Looking forward to working with you :)
--
Code snippet that used to work:
"function remove_enflod_lightox_cls($wp_classes){
if(($key = array_search('av-custom-lightbox', $wp_classes)) !== false) {
unset($wp_classes[$key]);
}
return $wp_classes;
}
add_filter('body_class','remove_enflod_lightox_cls');
function get_membershiped_level(){
global $post,$wpdb;
$membership_levels = $wpdb->get_col("SELECT membership_id FROM {$wpdb->pmpro_memberships_pages} WHERE page_id = '{$post->ID}'");
return $membership_levels;
}
function is_membershiped(){
if(get_membershiped_level()){
return true;
}
}
function is_showing_nextgen(){
global $post;
$pst_contnt = $post->post_content;
$using_cave_template = false;
/*
// more validated
if (!is_membershiped() && strpos($pst_contnt, "id='thecavecontentimages'") !== false) {
$using_cave_template = true;
}else if(!is_membershiped() && strpos($pst_contnt, "id='thecavefront'") !== false){
$using_cave_template = true;
}
*/
/*
// less validated
if (strpos($pst_contnt, "id='thecavecontentimages'") !== false) {
$using_cave_template = true;
}else if(strpos($pst_contnt, "id='thecavefront'") !== false){
$using_cave_template = true;
}
*/
if (strpos($post->post_name, "cave") !== false) {
$using_cave_template = true;
}
$disable_enfold_lightbox = get_post_meta($post->ID, '_disable_enfold_lightbox', true);
if($disable_enfold_lightbox==1){
$using_cave_template = true;
}
return $using_cave_template;
}
"
This has worked so far, but now it doesn't any longer.
The mission of this job is to customise the rule to have it take action again. If you have a better way of doing it, that's allowed too.
--
Bonus info:
The theme has a setting to DISABLE or ENABLE the theme lightbox.
If enabled = much of my content bugs out
If disabled = my content works. But the pages including 'cave' now have two lightboxes showing. To prevent this I had the custom rule to disable it only on these pages, but this does no longer work, probably due to plugin and theme updates.
The theme is Enfold by Kriesi.at and the gallery that I'm using as well is NextGen
--
I'll pick the best bid today as it's quite urgent. Looking forward to working with you :)
--
Code snippet that used to work:
"function remove_enflod_lightox_cls($wp_classes){
if(($key = array_search('av-custom-lightbox', $wp_classes)) !== false) {
unset($wp_classes[$key]);
}
return $wp_classes;
}
add_filter('body_class','remove_enflod_lightox_cls');
function get_membershiped_level(){
global $post,$wpdb;
$membership_levels = $wpdb->get_col("SELECT membership_id FROM {$wpdb->pmpro_memberships_pages} WHERE page_id = '{$post->ID}'");
return $membership_levels;
}
function is_membershiped(){
if(get_membershiped_level()){
return true;
}
}
function is_showing_nextgen(){
global $post;
$pst_contnt = $post->post_content;
$using_cave_template = false;
/*
// more validated
if (!is_membershiped() && strpos($pst_contnt, "id='thecavecontentimages'") !== false) {
$using_cave_template = true;
}else if(!is_membershiped() && strpos($pst_contnt, "id='thecavefront'") !== false){
$using_cave_template = true;
}
*/
/*
// less validated
if (strpos($pst_contnt, "id='thecavecontentimages'") !== false) {
$using_cave_template = true;
}else if(strpos($pst_contnt, "id='thecavefront'") !== false){
$using_cave_template = true;
}
*/
if (strpos($post->post_name, "cave") !== false) {
$using_cave_template = true;
}
$disable_enfold_lightbox = get_post_meta($post->ID, '_disable_enfold_lightbox', true);
if($disable_enfold_lightbox==1){
$using_cave_template = true;
}
return $using_cave_template;
}
"
Emil V.
100% (7)Projects Completed
8
Freelancers worked with
8
Projects awarded
37%
Last project
25 Mar 2018
Denmark
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies