Root url for website --------------------------------------------------------- title of specific post/page --------------------------------------------------------- Title of site --------------------------------------------------------- Site description --------------------------------------------------------- stylesheet folder location --------------------------------------------------------- style.css file location --------------------------------------------------------- pingback url --------------------------------------------------------- Template folder path --------------------------------------------------------- wordpress site version --------------------------------------------------------- atom url --------------------------------------------------------- rss2 url --------------------------------------------------------- Html version --------------------------------------------------------- charset parameter --------------------------------------------------------- ========================================================== Codes for Other Template Files Codes below will be seen across all template files such as single.php, index.php, page.php and so on. Its really easy to call on these codes to make your theme dynamic when coding it. ========================================================== Displays Header.php file content --------------------------------------------------------- Displays Footer.php file content --------------------------------------------------------- Displays Sidebar.php file content --------------------------------------------------------- Displays Comment.php file content --------------------------------------------------------- Displays the Content of the Post --------------------------------------------------------- Displays the excerpt that is used in Posts --------------------------------------------------------- Title of the Specific Post --------------------------------------------------------- Link of the Specific Post --------------------------------------------------------- Category of a Specific Post --------------------------------------------------------- Author of the Specific Post --------------------------------------------------------- ID of a Specific Post --------------------------------------------------------- – Edit link for a Post --------------------------------------------------------- URL of the Next Page --------------------------------------------------------- URL of the Previous Page --------------------------------------------------------- Lists all links in Blogroll --------------------------------------------------------- Lists all Pages --------------------------------------------------------- List Archive for the Site --------------------------------------------------------- Lists all Categories --------------------------------------------------------- Displays the Built in Calendar --------------------------------------------------------- Displays Register Link --------------------------------------------------------- Displays Login/Logout Link only to Registered Users --------------------------------------------------------- the date is ’02-15-14′ --------------------------------------------------------- link to comments of post --------------------------------------------------------- edit link of post/page --------------------------------------------------------- links from blogroll --------------------------------------------------------- list all pages --------------------------------------------------------- list all categories --------------------------------------------------------- url to next post --------------------------------------------------------- url to previous post --------------------------------------------------------- next and previous post link --------------------------------------------------------- rewinds post for a second loop --------------------------------------------------------- admin meta data --------------------------------------------------------- ========================================================== The Loop (Basic Loop) ========================================================== ========================================================== The Loop (Advance Loop) ==========================================================

Posted in | |'); ?>

Not Found

Sorry, but you are looking for something that isn't here.

========================================================== Navigation Menu Navigation Menu (Default) ========================================================== Navigation Menu (Specific) --------------------------------------------------------- 'Project Nav' )); ?> Navigation Menu (Category Based) --------------------------------------------------------- Navigation Menu (Page Based) --------------------------------------------------------- Comments popup link --------------------------------------------------------- if statemant for post find/search --------------------------------------------------------- while statemant --------------------------------------------------------- End while statemant --------------------------------------------------------- End if statemant --------------------------------------------------------- ========================================================== Get Featured Image URL with Proper size Array ========================================================== ID), array( 900,900 ), false, '' ); echo $src[0]; ?> Feature iamge query with direct hyperlink --------------------------------------------------------- ID); preg_match ('/src="(.*)" class/',$thumbnail_id,$link); echo $link[1]; ?> Feature iamge query with direct link for Lightbox --------------------------------------------------------- ID); preg_match ('/src="(.*)" class/',$thumbnail_id,$link); echo $link[1]; ?> ========================================================== Display all Custom Texonomies list ========================================================== ========================================================== URL / permalink rewrite issue fix for (Recipe) Custom Post ========================================================== add_action('init', 'firmasite_resimlitarif_cpt', 0); function firmasite_resimlitarif_cpt() { // Recipe Custom Post $args = array( 'public' => true, 'show_in_menu' => true, 'permalink_epmask' => EP_NONE, 'rewrite' => array('slug'=>'/','with_front'=>false), 'has_archive' => false, 'supports' => array('title','editor','thumbnail') ); register_post_type('recipe',$args); } add_action("parse_query", 'firmasite_resimlitarif_parse_query'); function firmasite_resimlitarif_parse_query($query) { global $wp, $wp_rewrite; // Is this query for /%post_name%/? Is it main request query? if (isset($query->query['name']) && substr($wp->matched_rule, 0, 7) == "([^/]+)" && isset($query->query) && isset($wp->query_vars) && $query->query == $wp->query_vars) { if (!($post_types = get_query_var("post_type"))) { if ($wp_rewrite->permalink_structure == "/%postname%/") $post_types = array("post"); else $post_types = array(); } if (is_array($post_types)){ $post_types[] = 'recipe'; $post_types[] = 'page'; } set_query_var("post_type", $post_types); } } ========================================================== Add metabox, save data in post, page, post-type ========================================================== // Little function to return a custom field value function wpshed_get_custom_field( $value ) { global $post; $custom_field = get_post_meta( $post->ID, $value, true ); if ( !empty( $custom_field ) ) return is_array( $custom_field ) ? stripslashes_deep( $custom_field ) : stripslashes( wp_kses_decode_entities( $custom_field ) ); return false; } // Add the Metabox function wpshed_add_custom_meta_box() { add_meta_box( 'wpshed-meta-box', __( 'Metabox Example', 'textdomain' ), 'wpshed_meta_box_output', 'post', 'normal', 'high' ); add_meta_box( 'wpshed-meta-box', __( 'Metabox Example', 'textdomain' ), 'wpshed_meta_box_output', 'page', 'normal', 'high' ); add_meta_box( 'wpshed-meta-box', __( 'Metabox Example', 'textdomain' ), 'wpshed_meta_box_output', 'post_type_name', 'normal', 'high' ); //show in custom post } add_action( 'add_meta_boxes', 'wpshed_add_custom_meta_box' ); // Output the Metabox function wpshed_meta_box_output( $post ) { // create a nonce field wp_nonce_field( 'my_wpshed_meta_box_nonce', 'wpshed_meta_box_nonce' ); ?>


ID,'pricing_class',true); if ($a){ echo $a; } ?> ========================================================== Query Recent 10 Post title From a Category ========================================================== 1, 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => 10, 'caller_get_posts'=> 1 ); $my_query = null; $my_query = new WP_Query($args); if( $my_query->have_posts() ) { echo 'List of Posts'; while ($my_query->have_posts()) : $my_query->the_post(); ?>

========================================================== Add Menu Support in Theme ========================================================== function register_my_menus() { register_nav_menus( array( 'primary' => __( 'Primary Navigation', 'portfolium' ), ) ); } Show Menu In wordpress Header ---------------------------------------------------------- 'menu-header', 'theme_location' => 'primary' ) ); ?> ADD icon in menu Li ---------------------------------------------------------- 'wpj-main-menu', 'menu_class' => 'nav navbar-nav', 'link_before' => ' ', 'link_after' => ' ', 'fallback_cb' => 'wpj_default_menu' ));} else {wpj_default_menu();} ?> ========================================================== Register sidebars and widget areas ========================================================== function fctheme_widget_areas() { register_sidebar( array( 'name' => __( 'About Us Page Content', 'freelancingcare' ), 'id' => 'about_us_text', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } add_action('widgets_init', 'fctheme_widget_areas'); Use Widget Code in Template Page ----------------------------------------------------------
//Write your default data
========================================================== Get author list in particular post category sort by post count ========================================================== post_author]+=1; // Authors Post Limit } arsort($catauthors); //sort array in reverse order by number of posts foreach($catauthors as $key => $author_post_count) { $curuser = get_userdata($key); $author_post_url=get_author_posts_url($curuser->ID, $curuser->nicename); echo '

--User nicename: '.$curuser->user_nicename .', display name: '. $curuser->display_name . ', number of posts in category '.$my_cat_id.': ' .$author_post_count .', link to all posts by this author: user_nicename ) . '" ' . '>' . $curuser->user_nicename .'

'; } } ?> Another Easy code for author list ---------------------------------------------------------- ========================================================== Count all the post for a category ========================================================== posts LEFT JOIN $wpdb->term_relationships ON($wpdb->posts.ID = $wpdb->term_relationships.object_id) LEFT JOIN $wpdb->term_taxonomy ON($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) WHERE $wpdb->term_taxonomy.term_id = 5 AND $wpdb->term_taxonomy.taxonomy = 'category' AND $wpdb->posts.post_status = 'publish' AND post_author = '1' "; $user_count = $wpdb->get_var($counter); echo $user_count; ?> ========================================================== Conditional Text for Logged user and guest in wordpres ========================================================== ========================================================== Activate ReduxFramework Admin Panel ========================================================== // Include the Redux theme options Framework if ( !class_exists( 'ReduxFramework' ) ) { require_once( dirname( __FILE__ ) . '/ReduxCore/framework.php' ); } // Tweak the Redux framework, Register all the theme options, Registers the wpex_option function if ( !isset( $redux_demo ) ) { require_once( dirname( __FILE__ ) . '/functions/admin-config.php' ); }