need bit of help, so I am looking into a plugin created for newsletter where default is it shows ad but it has option to remove ads by checking the check box. Default is to send ads in newsletter but if you don't want to send ads through newsletter then check the box. The problem is, it seems like checkbox selected is not being picked up. Some help would be appreciated.
The custom field in wp:
'label' => 'Hide newsletter ads',
'name' => 'hide_ads',
'type' => 'checkbox',
'instructions' => 'Checking the checkbox will remove ads',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'choices' => array(
'Hide newsletter ads' => 'Hide newsletter ads',
),
'allow_custom' => 0,
'default_value' => array(
),
'layout' => 'block',
'toggle' => 0,
'return_format' => 'value',
'save_custom' => 0,
),
The PHP code
<?php
$hide_newsletter_ads = get_field('hide_ads');
?>
<div class="wrap">
<?php
if (!$hide_newsletter_ads) {
include ABSPATH . 'path/ad-banner.php';
}
?>
<div class="wrap">
<?php
endif;
endif;
if (!$hide_newsletter_ads) {
(0 === $count) {
include ABSPATH . 'path/ad-1.php';
}
if (1 === $count) {
include ABSPATH . 'path/ad-2.php';
}
}
$count++;
endwhile;
endif;
?>
</div>
Aucun commentaire:
Enregistrer un commentaire