Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Shahjahan Jewel techjewel

🎯
Focusing
View GitHub Profile
@techjewel
techjewel / wp-login-logo-change
Created Apr 20, 2013
wordpress custom login logo change function
View wp-login-logo-change
<?php
/* ------------------------------------------------
Custom login image logo
------------------------------------------------ */
function my_custom_login_logo() {
echo '<style type="text/css">
h1 a { background-image:url('.get_bloginfo('template_url').'/images/loginlogo.png) !important; }
</style>';
}
add_action('login_head', 'my_custom_login_logo');
@techjewel
techjewel / Get Featured image
Created Sep 8, 2013
WordPress Featured image
View Get Featured image
@techjewel
techjewel / Wordpress Sortcode use in PHP template
Created Sep 9, 2013
Use sortcode in wordpress template file
View Wordpress Sortcode use in PHP template
<?php echo do_shortcode("[shortcode]"); ?>
@techjewel
techjewel / Convert Numbers to Words - Bangladesh.php
Last active Oct 31, 2020
Convert Numbers to Words - for Bangladeshi counting system
View Convert Numbers to Words - Bangladesh.php
<?php
/**
* Function: convert_number
*
* Description:
* Converts a given integer (in range [0..1T-1], inclusive) into
* alphabetical format ("one", "two", etc.)
*
* @int
*
@techjewel
techjewel / g-chart-vertical-text.js
Created Oct 3, 2013
Google chart api for show lebel in vertical axix
View g-chart-vertical-text.js
var options = {
title: "Test",
hAxis: {
direction:-1,
slantedText:true,
slantedTextAngle:90 // here you can even use 180
}
};
@techjewel
techjewel / smoothScrolling.js
Created Oct 25, 2013
Smooth Scrolling with jQuery
View smoothScrolling.js
<script type="text/javascript">
$('a').click(function(){
$('html, body').animate({
scrollTop: $( $.attr(this, 'href') ).offset().top
}, 800);
return false;
});
</script>
@techjewel
techjewel / wordpress_domain_issue
Created Nov 6, 2013
make domain.com/wordpress/ to domain.com
View wordpress_domain_issue
#paste this into domain.com/wordpress installation .htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
@techjewel
techjewel / WordPress_Jquery.php
Created Nov 12, 2013
change default source of jQuery in wordpress
View WordPress_Jquery.php
<?php
function add_scripts() {
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery',
'//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js');
wp_enqueue_script( 'jquery' );
}
add_action('wp_enqueue_scripts', 'add_scripts');
@techjewel
techjewel / ubuntu_commands
Created Dec 6, 2013
Useful command line for Ubuntu
View ubuntu_commands
move/rename a folder: mv /home/user/oldname /home/user/newname
Delete a folder with files: rm -rf Folder_name
@techjewel
techjewel / simple-add-this.php
Last active Dec 31, 2015
This is a very simple code snippet to add social button as sortcode in wordpress
View simple-add-this.php
<?php
// paste this section in your functions.php
function j_add_this_social() {
return '<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_button_pinterest_pinit" pi:pinit:layout="horizontal"></a>
<a class="addthis_counter addthis_pill_style"></a>
</div>
<script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>