Tutorials
Category
26 posts found
This function I was made specially for my theme which is running in this blog. I made function because Gravatar generate random images on each user’s avatar if user not uploaded real image, this function will not work no localhost so please use domain path eg: domain.com/wp-content/themes/mytheme/images/DefaultAvatar.jpg [php] function getavatar_src($author_idOrEMAIL=0,$size=50){
In Current 4.9 or preview versions we cannot get the_excerpt or get_the_excerpt by post ID so here is a little bit hack code to get excerpt paragraph of post by postID with alternate code [php] $postID=1; $postDATA = get_post($postID); $wordLength = 15; echo wp_trim_words( strip_shortcodes($postDATA->post_content) ,$wordLength); [/php
Post in
Laravel provide a great solution for login authentication, in sometimes we have typically a database table with custom table name eg: student, customer, employee, and custom login columns eg:student_id, customer_id, employee_id but the default in Laravel authentication only use id, login and password columns. To get install laravel from composer
This is weird thing from #laravel on fresh installation, so everyone wants to remove public from url, there are two different methods. 1. Method is remove public from url in #.htaccess Create .htaccess file on main directory of laravel and put the following code [html] <IfModule mod_rewrite.c> RewriteEngine On RewriteRule
Post in
Undefined index error occurred when you are using custom login with custom columns default #laravel use password column eg: you have defined column just like entity_password in database and you have passed in $credential array for auth()->guard(); This is wrong for login auth [php] public function LoginAuth_Method(){ $credentials = [‘entity_email’=>’customlaravel_login@sdtuts.com’,’entity_password’=>’ThePassword!!’]; $studentAuth
Post in
[php] CMD >> D:\xampp\htdocs\laravelproject>php artisan key:generate //’key’ => env(‘U9pdjHIWJtqOHvLCYoRgqFjGv2ryAdKB’), ‘key’ => env(‘ENTER HERE GENERATED VALUE’), //’cipher’ => ‘AES-256-CBC’, ‘cipher’ => MCRYPT_RIJNDAEL_128, [/php
Post in
I was development a section a in my #wordpress theme I need the current category from url, here is I figure out how to get category from url. [php] $page_position = strpos($_SERVER[‘REQUEST_URI’],’page’); if($page_position!==false){ $CAT_URL = substr($_SERVER[‘REQUEST_URI’],0,$page_position); } else { $CAT_URL = $_SERVER[‘REQUEST_URI’]; } $urlslugArray = array_filter(explode(‘/’,$CAT_URL)); $get_the_category = get_category_by_slug(end($urlslugArray)); if($get_the_category){
Post in
The #wordpress concatenating […] in #the_excerpt and sometimes with [&hellip]; I here function defined as trim_excerpt and it passed in add_filter you can copy and put the following code in functions.php file of your current active theme. [php] function trim_excerpt($text){ return rtrim(str_replace(‘[&hellip’, ”, $text), ‘[…]’); } add_filter(‘get_the_excerpt’, ‘trim_excerpt’); [/php] little bit information about add_filter
Post in
the_category(); function is not allowing to direct change tags and attributes, get_the_category(); function return categories of posts in array so we can modify with custom html tags and attributes check out the below example code, its used in under loop of #the_loop. [php] //Get categories $the_postid; $categories = get_the_category($the_postid); if(is_array($categories)){
Post in
#wordpress is show too much text the the_excerpt, so we need to customize it for showing shorted excerpt paragraph. copy this code and paste into your current active theme’s functions.php file [php] function my_custom_excerpt_length($length){ return 100; } add_filter(‘excerpt_length’, ‘my_custom_excerpt_length’, 999); [/php] set different post excerpt length for mobile devices wp_is_mobile
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