Skip to content

Instantly share code, notes, and snippets.

View shahidulislamus's full-sized avatar

shahidul islam rony shahidulislamus

View GitHub Profile
@shahidulislamus
shahidulislamus / Custom post query with custom field wordpress
Last active August 29, 2015 14:14
hear "put_hear_custom_field's_variable"="custom field's value pass by its variable" ===========hear "job_link"="pass that variable's value into this" ==========hear "put_hear_your_post_type_neme"="put hear the custom post type name i mean register_post_type('this name'array());"
<?php
global $post;
$args = array( 'posts_per_page' => 10, 'post_type'=> 'put_hear_your_post_type_neme' );
$myposts = get_posts( $args );
foreach( $myposts as $post ) : setup_postdata($post); ?>
<?php
$job_link= get_post_meta($post->ID, 'put_hear_custom_fields_variable', true);
?>
@shahidulislamus
shahidulislamus / all theme support
Created January 25, 2015 05:51
all theme supports in a wordpress theme......... copy and paste into functions.php or is going to include folder by any name which is include into functon.php as include_once('include/theme_support.php'); with out the php ending syntaxt
<?php
add_theme_support( 'post-formats', array( 'aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat') );
add_theme_support( 'custom-background');
add_theme_support( 'custom-header' );
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'html5', array( 'comment-list', 'comment-form', 'search-form', 'gallery', 'caption' ) );
add_theme_support( 'title-tag' );
?>
@shahidulislamus
shahidulislamus / wp_nav_menu
Created January 25, 2015 06:03
to call a menu in may be header.php ======hear all value is default value ========but i can not understand the items_wrap
<?php
$defaults = array(
'theme_location' => '',
'menu' => '',
'container' => 'div',
'container_class' => '',
'container_id' => '',
'menu_class' => 'menu', //this class is for ul=""
'menu_id' => '',
@shahidulislamus
shahidulislamus / register_nav_menus
Last active August 29, 2015 14:14
this is going to function.php
function register_my_menus() {
register_nav_menus( array(
'header_menu' => 'this menu is going to header',
'footer_menu' => 'this menu is going to footer',
) );
}
add_action( 'init', 'register_my_menus' );
@shahidulislamus
shahidulislamus / custom post very shortly
Created January 25, 2015 06:19
hear a slider post type
function slider_custom_post(){
register_post_type('slider',array(
'public'=>true,
'label'=>'slider',
'labels'=>array(
'name'=>'slider',
'singular_name'=>'slide',
'add_new'=>'add a new slide',
),
'supports'=>array(
@shahidulislamus
shahidulislamus / wordpress daynamic code
Created January 25, 2015 06:41
some code is mostly necessary this is that code
<?php language_attributes(); ?> is going to lang="en"
<?php bloginfo(''charset); ?> is going to utf-8
<?php wp_title('|',true,'right'); ?> is going to utf-8
<?php echo get_template_directory_uri(); ?> is to access template directory
<?php bloginfo('stylesheet_url'); ?> is replace this main style which is stay in root directory http="you must put hear that code"
@shahidulislamus
shahidulislamus / wordpress theme details
Created January 25, 2015 06:43
this code is going to style.css
/*
Theme Name: Twenty Fifteen
Theme URI: https://wordpress.org/themes/twentyfifteen
Author: the WordPress team
Author URI: https://wordpress.org/
Description: Our 2015 default theme is clean, blog-focused, and designed for clarity. Twenty Fifteen's simple, straightforward typography is readable on a wide variety of screen sizes, and suitable for multiple languages. We designed it using a mobile-first approach, meaning your content takes center-stage, regardless of whether your visitors arrive by smartphone, tablet, laptop, or desktop computer.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: black, blue, gray, pink, purple, white, yellow, dark, light, two-columns, left-sidebar, fixed-layout, responsive-layout, accessibility-ready, custom-background, custom-colors, custom-header, custom-menu, editor-style, featured-images, microformats, post-formats, rtl-language-support, sticky-post, threaded-comments, translation-ready
/*medium screen*/
@media only screen and (min-width:992px) and (max-width:1199px){
/*all medium screen code is going hear*/
body{
background-color:red;
}
}
/*Tablet layout*/
@media only screen and (min-width:768px) and (max-width:991px){
@shahidulislamus
shahidulislamus / register_sidebar
Last active August 29, 2015 14:14
register sidebar which is generally called widget
function my_moderna_theme_widget() {
//how to register a widget
register_sidebar( array(
'name' => 'footer widget coloum 1', //the name of sidebar
'id' => 'footer_widget_coloum1', //an id to call this
'description' => 'put hear a widget to view in footer 1', // write it's description
'before_widget' => '<div class="widget">', //which html code go befor widget
'after_widget' => '</div>', //which html code go after widget
step 1. get files backup
step 2. get dateabase backup
step 3. change URL in database
step 4. Upload files in new location
step 5. extract files
step 6. create a database & database username & assagin it.
step 7. inport database in newly created database.
step 8. add database information to wp-config.php file
after this step you can enjoy you own site