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
@mehedicsit
mehedicsit / learn how to enque style and js with wordpress
Created December 30, 2014 09:21
latest enque style and js for wordpress
<?php
function corlate_enque_css_js(){
//Adding CSS files
wp_register_style('bootstrap',get_template_directory_uri() . '/css/bootstrap.min.css',array(),'3.0.3','all');
wp_register_style('font-awesome',get_template_directory_uri() . '/css/font-awesome.min.css',array(),'4.0.3','all');
wp_register_style('animate',get_template_directory_uri() . '/css/animate.min.css',array(),'0.1.9','all');
wp_register_style('prettyPhoto',get_template_directory_uri() . '/css/prettyPhoto.css',array(),'3.1.5','all');
wp_register_style('main',get_template_directory_uri() . '/css/main.css',array(),'1.0.0','all');
wp_register_style('responsive',get_template_directory_uri() . '/css/responsive.css',array(),'1.0.0','all');
<?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 / important web address list for web design
Last active August 29, 2015 14:13
important web address list
https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries
http://www.9lessons.info/
http://www.lingulo.com/
http://learn.shayhowe.com/advanced-html-css/css-transforms/#transform-syntax
http://www.css3.info/preview/box-shadow/
http://www.standardista.com/css3/css3-transform-property-and-the-various-transform-functions/
http://callmenick.com/2014/03/06/image-overlay-hover-effects-with-css3-transitions/
http://cssdeck.com/labs/responsive-hexagonal-grid
http://graphicsbay.com/category/Featured/Web%20Templates/8
http://mag.splashnology.com/article/free-psd-web-templates/13566/
@mehedicsit
mehedicsit / how to query wordpress post loop
Last active August 29, 2015 14:13
wordpress query post loop
http://wordpress.stackexchange.com/questions/117219/why-should-i-put-ifhave-posts-is-whilehave-posts-not-enough
/*this is the main link of query post expalnation*/
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
/*this is the explanation of why we will use post loop*/
@mehedicsit
mehedicsit / important link of post loop
Created January 17, 2015 18:03
important link of post loop
http://codex.wordpress.org/Function_Reference/query_posts
http://codex.wordpress.org/Function_Reference/have_posts
http://codex.wordpress.org/The_Loop
@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 */