-
Get post meta custom field in wordpress October 16, 2017
<?php $key_value = get_post_meta( get_the_ID(), ‘photoPrice’, true ); ?> <h2> <?php echo $key_value ?></h2>read more
-
WordPress Useful Plugins October 13, 2017
Simple Database Export+Import+Migration Adminer ( formerly phpMinAdmin) All In One Php ( Executes PHP code on WordPress page) Insert...read more
-
Related posts from subcategories – category in wordpress October 4, 2017
<?php $related = get_posts( $argsub = array( ‘category_name’ => ‘portfolioDetails’, //slug, not name!! ‘category__in’ => wp_get_post_categories( $post->ID ), ‘posts__in’...read more
-
Subcategories information from Category in wordpress October 4, 2017
<ul id=”dates”> <?php $subcategories = get_categories(‘&child_of=12&orderby=id&order=DESC’); //&child_of=12&orderby=id&order=DESC foreach ($subcategories as $subcategory) { $thumb_id = get_post_thumbnail_id($post->ID); $thumb_url_array = wp_get_attachment_image_src($thumb_id, ‘thumbnail-size’,...read more
-
Display Subcategories and its Count on Category in wordpress October 4, 2017
<?php if (is_category()) { $this_category = get_category($cat); } ?> <?php if($this_category->category_parent) $this_category = wp_list_categories(‘orderby=id&show_count=0 &title_li=&use_desc_for_title=1&child_of=’.$this_category->category_parent. “&echo=0”); else $this_category =...read more
-
Get related category names from parent category in wordpress September 5, 2017
<?php foreach((get_the_category()) as $category) { echo $category->cat_name. ”; } ?>read more
-
How to rewrite page url page/2 to ?page=2 July 13, 2017
Please paste in .htaccess file # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /blog/ RewriteRule ^index\.php$ – RewriteCond...read more
-
Display Posts Count from Category in WordPress June 22, 2017
//class-walker-category.php //add in @206 $chosen_id = $category; $thisCat = get_category($chosen_id); $count = $thisCat->count; $output .= “>$link\n”.”(“.$count.”)”;read more
-
Get post custom field in wordpress June 7, 2017
<?php $custom_fields = get_post_custom($post->ID); $my_custom_field = $custom_fields; foreach ( $my_custom_field as $key => $value ) { echo $key ....read more
-
How to create Category with posts content in wordpress June 7, 2017
<div class=”row”> <?php $query = new WP_Query( ‘cat=0,2’ ); ?> <?php if ( $query->have_posts() ) : while ( $query->have_posts()...read more