Below, you’ll find a detailed guide on how to add the Automatic Pages For Privacy Policy Terms About And Contact Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Automatic Pages For Privacy Policy Terms About And Contact Plugin shortcode not to show or not to work correctly.
Before starting, here is an overview of the Automatic Pages For Privacy Policy Terms About And Contact Plugin and the shortcodes it provides:
"Automatic Pages for Privacy Policy, Terms, About, Contact Us is a convenient WordPress plugin. It auto-generates essential pages for your website, ensuring compliance and professionalism."
- [MyCONTACT_FORM]
Automatic Pages For Privacy Policy Terms About And Contact [MyCONTACT_FORM] Shortcode
The ‘MyCONTACT_FORM’ shortcode is used to generate a contact form on a WordPress site. It creates a form with fields for the user’s name, email, and a text area for the message. The form includes an anti-spam feature, which prompts the user to solve a simple math problem before submitting. This function is customizable and can be styled with CSS.
Shortcode: [MyCONTACT_FORM]
Examples and Usage
Basic example – A shortcode that displays a contact form with name, email, and message fields.
[MyCONTACT_FORM /]
Advanced examples
Using the shortcode to display a contact form with an additional custom field. The custom field is added using the ‘extra_block’ attribute. This can be used to add any additional fields to the form.
[MyCONTACT_FORM extra_block='Your Age ' /]
Using the shortcode to display a contact form with a custom anti-spam question. The question is generated using the ‘rand’ and ‘multiplier’ attributes. This can be used to add a custom anti-spam measure to the form.
[MyCONTACT_FORM rand=5 multiplier=2 /]
Please note that in the advanced examples, the ‘extra_block’ and ‘rand’/’multiplier’ attributes are used to customize the form. These attributes are optional and the form will function without them, as shown in the basic example.
PHP Function Code
In case you have difficulties debugging what causing issues with [MyCONTACT_FORM]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode('MyCONTACT_FORM', 'contacttt_form' );
Shortcode PHP function:
function contacttt_form($extra_block=''){ $rand= rand(1,111); $multiplier=date('j');
$extra_bl =(!is_array($extra_block) ? $extra_block : '');
$x = utf8_declarationn() . '
<div id="contac_DIV">'
.'<style type="text/css"> #submitContatForm{cursor:pointer;} .cf_formm{ display:block; margin:0 auto;} .cf_formm table{width:100%; max-width:400px; margin:0 auto;} .brdr{ border-radius:5px; border:1px solid; padding:3px; margin:5px; background-color:#E6E6E6; } .cfinputt{display:block; width:92%; height:30px; min-width:140px; } .cftxtarea{display:block; width:96%; height:200px;} .submt{ cursor:pointer; } td{vertical-align: middle;} td.leftflot{float:left; padding:0 0 0 10px;} span.antWORD{font-weight:bold;} </style>'
.'<form class="cf_formm" action="" method="POST" id="contactFormID" target="_blank"> <input type="hidden" name="contactIsSubmited" value="y" />'
.'<table><tbody>'
.$extra_bl
.'<tr><td>Your Name</td><td><input class="cfinputt brdr" name="namee" value="" placeholder="" type="text" /></td></tr>'
.'<tr><td>Your Mail</td><td><input class="cfinputt brdr" name="emailii" value="" placeholder="" type="text" /></td></tr>'
.'<tr><td colspan="2"><textarea class="cftxtarea brdr" name="teext"/></textarea></td></tr>'
.'<tr><td><span class="antWORD">'. $rand . "*". $multiplier.'=<input type="hidden" name="initiall" value="'. $rand .'" /></span></td><td class="leftflot"><input class="cfinputt brdr" type="text" value="" name="antiSpamm" /></td></tr>'
.'<tr><td><input class="cfinputt brdr submt" type="submit" value="SEND" id="submitContatForm" /></td><td> </td></tr>'
.'</tbody></table>'
.'</form>'
.'</div>';
return $x;
}
Code file location:
automatic-pages-for-privacy-policy-terms-about-and-contact/automatic-pages-for-privacy-policy-terms-about-and-contact/library_wp.php
Conclusion
Now that you’ve learned how to embed the Automatic Pages For Privacy Policy Terms About And Contact Plugin shortcode, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.
Leave a Reply