Jump to content


  • Posts

  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

toolman's Achievements

Advanced Member

Advanced Member (4/5)



  1. Hi there, Thank you for the reply. Thanks, that works great with the text if its already set. However, If I try to pull it through using the WordPress function I have, It outputs the whole text. This is what I tried: <?php $text = wpjm_the_job_description(); $words = array_slice(explode(' ', $text), 0, 15); echo join(' ', $words) . '…'; ?>
  2. Hi, Thanks for the replies. I'm happy with the one I have above, so if there is a way I can truncate that, that would be ideal. With regards to phpmillion, it is outputting everything, but what I meant was the code I have is not doing anything, so I guess I have something wrong with it. I am happy the character count, but ideally word count would be better.
  3. Hi there, I'm trying to truncate some text by 15 words which is then followed by a "..." This is the line that outputs all the text: wpjm_the_job_description(); I've tried this, but nothing is happening. <?php $desc=wpjm_the_job_description(); echo substr($desc, 0, 15); ?> Any ideas what I have wrong? Thanks
  4. Hi, I'm trying to escape the following: 'label' => __( 'Title <span class="tooltips" title="Give your title a catchy title, ideally starting with the word \"test"\> All it is displaying is a backslash. Any ideas why this is? Thanks
  5. Hi, I'm trying to create a simple bit of PHP that will display today's date +3 days. This is what I have: echo "Order today to receive by " . date("l j F Y")+3; I am new to PHP, but what I am trying to do is to add 3 days to a date is the day is a week day and add 5 days if the day is a weekend. How would I achieve this?
  6. Hi, By custom page I mean like a "thank you" page or "error" page. The footer-contact.php file is the file that contains the PHP code.
  7. Hi there, I have the following code which adds a reCAPTCHA to my form, however, I would like to send it to a custom page to display the error or success message. Also, I would like the form to be submitted to my email address with a subject and details of the form completed. How would I do this? This is the code: <form action="footer-contact.php" class="form-horizontal" method="POST"> <div class="form-group"> <label class="col-md-4 control-label">Name:</label> <div class="col-md-6"> <input type="text" class="form-control" name="name" placeholder="Enter Name" required="" /> </div> </div> <div class="form-group"> <label class="col-md-4 control-label">Email:</label> <div class="col-md-6"> <input type="text" class="form-control" name="email" placeholder="Enter Email" required="" /> </div> </div> <div class="form-group"> <label class="col-md-4 control-label">Message:</label> <div class="col-md-6"> <textarea type="text" class="form-control" name="message" placeholder="Enter Message" required=""></textarea> </div> </div> <div class="form-group"> <label class="col-md-4 control-label">Captcha:</label> <div class="col-md-6"> <div class="g-recaptcha" data-sitekey="mySiteKey"></div> </div> <div class="form-group"> <div class="col-md-6 col-md-offset-6" class="text-center"> <br/> <input class="btn btn-success" type="submit" name="submit" value="Submit"> </div> </div> </form> <?php if($_SERVER["REQUEST_METHOD"] === "POST") { $recaptcha_secret = "mySecretKey"; $response = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$recaptcha_secret."&response=".$_POST['g-recaptcha-response']); $response = json_decode($response, true); if($response["success"] === true){ echo "Form Submit Successfully."; }else{ echo "You are a robot"; } } ?> Any help would be great! Thanks.
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.