Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

Send Mail from an AMP page

In one of my projects I embedded Google's new open-source initiative, AMP(Accelerated Mobil Pages). It was a WordPress website. I was all done with most of the part of website, however there was still a module which needs research i.e. implementing contact form into website.

While, we implementing any form in a website, we need to add validations as well as the data-handler scripts. So, I had two problems to resolve on:

Calculate Fortnight Date

The following code will calculate a recurring fortnightly date from a given date, i.e. a star-date. The date format should be 'Y-m-d' for the following code. However, you can make updates in it as per requirements.

For example: The start date for the fortnight cycle date was set to be as "2018-01-10". Then, as per current cycle, next will be 2018-02-20.

WordPress AMP Plugin

WordPress AMP add AMP(Accerlated Mobile Pages) support to a WordPress website. WordPress AMP provides support for the inbuilt post types as well as the custom post types and custom taxonomies.

Introduction to PHP

  • PHP is open source scripting language widely used for the web development. It was introduced in 1995 and is influenced by other scripting languages such as Perl, Java, C, C++.
  • PHP stands for 'Preprocessor Home Page'.
  • PHP scripts are executed on the web-server.

Run shortcodes from a custom field.

By default, WordPress Custom Fields display any of the string you enter, as plain-text. In same way when you try to execute a shortcode, (in the format [shortcode] VALUE [/shortcode]) you end up displaying the entire text, including the html tags.

This is because, Wordpress do not run shortcodes added to custom fields.

How to Change the Comment Notification Email in WordPress

When someone leaves comment on a WordPress post, the system sends a notification e-mail to the author of particular post. By this way, whenever a comment is published, post writer get informed about comment and can response immediately.

Find Related Posts Under Same Category/Tags

Nowadays very oftenly it is required to display related posts (or other post types) underneath your content. This engage readers, and provide them link to related posts to read, and effectively make them spend more time on website. Also, related posts come with added SEO benefits, as they provide internal links to your content. So, how you should go about displaying related posts in website?

To work with, you will need some sample content. So, let’s create a few posts and assign them on a few categories.

Implementation Steps:

Query to fetch latest rows data of second table CakePHP 3.x.

Query to fetch latest rows data of second table of a JOIN and all conditions as per the data of second table in CakePHP 3.x.

Enable PHP in Widget Without Plugin - WordPress

Getting started with PHP

Before starting use of PHP for developing websites its necessary that you should know about the basics of language. So, here we are trying to explain basics related to PHP programming.

1. Variable
A variable is basic element of a programming language. Variable is a main way to store information within a PHP program. The important things about variables in PHP is explained as following: