display content in multiple columns

found a simple solution ..I m posting full index.php <?php /** * Description: Default Index template to display loop of blog posts * * @package WordPress * @subpackage BootstrapWP */ get_header(); ?> <?php // Some sample styles for the images echo “<style type=”text/css”> .half { width: 50%; float: left; } .ng-row { clear: both; } … Read more

Set multi posts random categories and tags

Oh, I made it myself. Just run this function until you satisfy function Trang_Mix_CatesTags() { $cats = get_categories(array( ‘hide_empty’ => false, )); $query = new WP_Query(‘post_type=post&posts_per_page=-1&post_status=publish’); if( $query->have_posts() ): while($query->have_posts()): $query->the_post(); $numbers = range(0, (count($cats)-1)); shuffle($numbers); $r = array_slice($numbers, 0, 5); $c = array( $cats[$r[0]]->term_id, $cats[$r[1]]->term_id, $cats[$r[2]]->term_id, $cats[$r[3]]->term_id, $cats[$r[4]]->term_id ); wp_set_post_categories( get_the_ID(), $c ); endwhile; … Read more

Display post in visual composer with custom html

You can create your own custom shortcode and then map it with vc_map(). You can read about it here: https://wpbakery.atlassian.net/wiki/pages/viewpage.action?pageId=524332 . You can also modify already existing visual composer shortcodes https://wpbakery.atlassian.net/wiki/pages/viewpage.action?pageId=524294 , but I didn’t tried that yet.

WP Pages: Add checkbox, save and display

Why are you using $_REQUEST[‘featured-page’]? Your input name is _featured-page and you should use $_POST not $_REQUEST. Try something like this. add_action(“admin_init”, “register_post_assets”); function register_post_assets(){ add_meta_box(‘featured-page’, __(‘Featured Page’), ‘add_featured_meta_box’, ‘page’, ‘advanced’, ‘high’); } function add_featured_meta_box( $post ){ global $post; $custom = get_post_custom($post->ID); $_featured-page = $custom[“_featured-page”][0]; ?> <label>Featured Page</label> <?php $is_featured = get_post_meta($post->ID, ‘_featured-page’, true); $checked … Read more

Display 6 most recent post on homepage?

I have checked your code please compare your WP_Query args with mine. Also, have a look on the available WP_Query args. $queryArgs = array( // Do not get posts from the Uncategorized category. ‘cat’ => ‘-1’, // Order by date. ‘orderby’ => ‘date’, // Show all posts. ‘posts_per_page’ => ‘6’, ‘post_type’ => ‘portfolio’, ‘post_status’ => … Read more