Skip to content

Instantly share code, notes, and snippets.

View techjewel's full-sized avatar
🎯
Focusing

Shahjahan Jewel techjewel

🎯
Focusing
View GitHub Profile
@techjewel
techjewel / wp-login-logo-change
Created April 20, 2013 18:28
wordpress custom login logo change function
<?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 September 8, 2013 11:20
WordPress Featured image
@techjewel
techjewel / Wordpress Sortcode use in PHP template
Last active December 16, 2021 16:41
Use sortcode in wordpress template file
<?php echo do_shortcode("[shortcode]");
@techjewel
techjewel / Convert Numbers to Words - Bangladesh.php
Last active April 14, 2023 20:51
Convert Numbers to Words - for Bangladeshi counting system
<?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 October 3, 2013 18:08
Google chart api for show lebel in vertical axix
var options = {
title: "Test",
hAxis: {
direction:-1,
slantedText:true,
slantedTextAngle:90 // here you can even use 180
}
};
@techjewel
techjewel / smoothScrolling.js
Created October 25, 2013 06:29
Smooth Scrolling with jQuery
<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 November 6, 2013 12:26
make domain.com/wordpress/ to domain.com
#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 November 12, 2013 01:05
change default source of jQuery in wordpress
<?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 December 6, 2013 22:13
Useful command line for Ubuntu
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 December 31, 2015 02:29
This is a very simple code snippet to add social button as sortcode in wordpress
<?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>