Tutorials
Category
26 posts found
Mostly #wordpress theme developers put header data information in header.php file of theme and they not use each different header file for each wordpress post or pages category and this is best dynamic and quick way to put header information in header.php like head tag and #css #javascript and other
Post in
This is default simple documentation of #laravel to send mail but problems is that this is static mail passed in parameter to(‘foo@sdtuts.com’) [php] Mail::send(’emailtemplate_view’, [‘data’ => ‘for_emailtemplate_view’], function($message){ $message->to(‘foo@sdtuts.com’, ‘SDTuts’)->subject(‘Welcome!’); }); [/php] We also need to pass the dynamic email, for example we used it for user registration steps to
Post in
This is big storage problem in computer, mobiles and all other devices, heavy and camera images consumed too many storage and website will become heavy if heavy images used on websites I also use my php code to lose images weight without losing dimension and quality of image Here is
Post in
I developed my custom code to get difference between two dates, code is different from #php date_diff because my code calculate the total number of seconds, minutes, days, months and years. Its best way to define this code in function to use any where of project where you want it,
Post in
#wordpress provide a good page template feature show page layout in different layouts like single-column, double-column, full-page, or custom-template. default template is page.php for page, so you want to show contact form or different layout from other page. To define your layout go to /wp-content/themes/theme_folder/ create file with php extension,
Post in
There is different way to access array and object many developers are use array instead object, if any a data get object and need to convert from object to array. Some are may be prefer to use object instead array, here is code example to quickly convert your large amount
Post in
By default #wordpress get_search_form function return default html of search form, you want to change or modify search form html here is example to replace whole search form. In below code we used #wordpress hook to modify search form html. [php] function sd_search_form($form){ $form = ‘<form class="search_form" role="search" method="get" id="searchform"
Post in
Please do not validate file extension on uploading file from user [php] $_FILE[‘file_name’]; $ext = pathinfo($_FILE[‘file_name’],PATHINFO_EXTENSION); $allow_ext=array(‘jpg’,’jpeg’,’png’,’gif’); if(in_array($ext,$allow_ext)){ //DO UPLOAD CODE } [/php] Hackers are created a fake jpg image with no preview and they add code encode on base64 or gzinflate on picture source when you will open that
Post in
In some where we need only thumbnail source link the function the_post_thumbnail cannot return thumbnail source link, we ca two ways to get thumbnail src. 1. wp_get_attachment_thumb_url [php] $post_id = get_the_ID(); $size = ‘thumbnail’; $thumb_src = wp_get_attachment_thumb_url(get_post_thumbnail_id($post_id),$size); echo ‘<img src="’.$thumb_src.’" />’; [/php] 2. get_attachment_src [php] $post_id = get_the_ID(); $size =
Post in
Create wordpress password for your theme function or plugins. [php] function generate_wp_pass($text_password) { require_once( ABSPATH . ‘wp-includes/class-phpass.php’); //IN 3.6 OR OLDER VERSION CANNOT AUTO LOAD PASSWORD CLASS SO YOU WILL NEED TO LOAD IT MANNUALLY $wp_hasher = new PasswordHash(8, true); return $hasher->HashPassword($text_password); } [/php
Post in
TOP COMMENTED
laravel remove public from url
This is weird thing from #laravel on fresh installation, so…
3 comments
Pakistani Web Designer’s Web Designing…
Web Design Illustrations - IdealHut.com by Design-Maker…
2 comments
MEASURE UNITS PX, CM, IN, MM CONVERSION…
[php]function measure_conversation($value = null, $measurein = null, $returnin = 'px',…
2 comments
28 Android IOS Mobile Application Frameworks
jQuery Mobile Ionic: Advanced HTML5 Hybrid Mobile App Framework Mobile…
2 comments
20 jQuery HTML5 Video Player for Website
Video.js The Player Framework MediaElement.js - HTML5 video player Create…
2 comments