Skip to content

Instantly share code, notes, and snippets.

View mehedicsit's full-sized avatar

Mehedi Hasan mehedicsit

View GitHub Profile
@mehedicsit
mehedicsit / enque style and script
Last active August 29, 2015 14:12
wordpress theme development
<?php
/*this is for init default jquery*/
function various_theme_jquery() {
wp_enqueue_script('jquery');
}
add_action('init', 'various_theme_jquery');
/*this is to enqueue js and css*/
@mehedicsit
mehedicsit / how to create custom header in wordpress
Last active August 29, 2015 14:12
Wordpress custom header
Custom Headers
Languages: English • Français • Hrvatski • Русский • 日本語 • Português do Brasil • 中文(简体) • (Add your language)
Custom Header is a theme feature introduced with Version 2.1. Custom header is an image that is chosen as the representative image in the theme top header section.
See also Appearance Header Screen.
Contents
1 Adding Theme Support
<?php
//**php for dynamic title***************************************************************************//
<title><?php bloginfo('name'); ?></title>
///***php for images and jequery slider******************************************************//
<?php echo get_template_directory_uri(); ?>/
//php for css***********************************************//
//If $y > 10, $x will say 'foo', else it'll say 'bar'
$x = ($y > 10) ? 'foo' : 'bar';
//Short way of saying <? print $foo;?>, useful in HTML templates
<?=$foo?>
//Shorthand way of doing the for loop, useful in html templates
for ($x=1; $x < 100; $x++):
//Do something
end for;
@mehedicsit
mehedicsit / full medai queries for css3
Created January 8, 2015 20:10
css3 media queries
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
}
/* Smartphones (landscape) ----------- */
@media only screen
and (min-width : 321px) {
@mehedicsit
mehedicsit / media queries of css3
Last active August 29, 2015 14:14
common media queries of css3
/* #1- Large desktop */
@media (min-width: 1200px) { ... }
/* #3- Regular sized laptops */
@media (min-width: 980px) and (max-width: 1199px) { ... }
/* #3- Portrait tablet to landscape and desktop */
@media (min-width: 768px) and (max-width: 979px) { ... }
/* #4- Landscape phone to portrait tablet */