none

quick fix | No Comments | July 22nd, 2021

I was trying to import a massive csv dataset into phpMyAdmin and it kept throwing error:Invalid field count in csv input on line 1
This was very annoying as it was all being done the way it always works for me!
To solve this I had to do the following:

Import
Browse for your csv file.
Select CSV using LOAD DATA (rather [...]

....Read More

none
none

wordpress | No Comments | April 8th, 2021

If you want to make posts orderby custom field … use below code .
proirity = Custom Field name
global $wp_query; function priority_select($sql){ global $wpdb; if (strpos($sql, ‘proirity’) !== false){ $sql = str_replace(”ORDER BY {$wpdb->postmeta}.meta_key”, “ORDER BY CAST({$wpdb->postmeta}.meta_key AS UNSIGNED)”, $sql); } return $sql; } add_filter(’query’, ‘priority_select’); [...]

....Read More

none
none

wordpress | No Comments | March 18th, 2021

I can’t upload .3gp to wordpress.
Solution:
Edit wp-includes/functions.php,
search for:
1
‘mp4|m4v’ => ‘video/mp4′,
add a line after it:
1
‘3gp’ => ‘video/3gpp’,
Done!
You may want to add other filetypes you also enjoy here.

....Read More

none
none

hosting | No Comments | March 17th, 2021

Before developers can serve their website to the world, they need to decide on which of the many web hosting companies to use. One criterion that web developers look for in a hosting company is support to run applications. Because many applications on the web are written using PHP, developers need to find a company [...]

....Read More

none
none

wordpress | No Comments | November 20th, 2021

show the subcategories for a given category on it’s category page .Basically you need to check whether there are any children, and if there are, list the categories with the current category as a parent or grandparent. The following code does just that:
if (is_category()) {
$this_category = get_category($cat);
if (get_category_children($this_category->cat_ID) != “”) {
[...]

....Read More

none
none

wordpress | No Comments | September 10th, 2021

After my latest WordPress update (which as a manual one, with a whole lot of  mysql issues!) I finally got my blog up and running again, only to find all my apostrophes appearing as “â€TM” –stupid junk characters. After going into panic mode for about two minutes, I figured out the solution, at least in [...]

....Read More

none
none

quick fix | No Comments | February 8th, 2021

use this function ::
function first_sentence($content) {

$pos = strpos($content, ‘.’);

if($pos === false) {
return $content;
}
else {
return substr($content, 0, $pos+1);
}

}
and then call [...]

....Read More

none