WordPress.org

Ready to get started?Download WordPress

Forums

Theme function extending (2 posts)

  1. RSLiam
    Member
    Posted 10 months ago #

    Using the Theme ZeeDynamic. I'm trying to modify it to show frontpage blog posts from multiple categories. Direct theme support is paid, so I'm here instead!

    Settings to tell theme to use posts from specific category (settings-frontpage.php)

    ### FRONTPAGE POSTS
    		#######################################################################################
    		$themezee_settings[] = array("name" => __('Display Latest Blog Posts?', 'zeeDynamic_language'),
    						"desc" => __('Check this to show the latest blog posts in the normal blog layout on the frontpage template', 'zeeDynamic_language'),
    						"id" => "themeZee_frontpage_posts_active",
    						"std" => "false",
    						"type" => "checkbox",
    						"section" => "themeZee_frontpage_posts");
    
    		$themezee_settings[] = array("name" => __('Latest Blog Posts Category', 'zeeDynamic_language'),
    						"desc" => __("Select the category of which the latest blog posts should be displayed.", 'zeeDynamic_language'),
    						"id" => "themeZee_frontpage_posts_category",
    						"std" => "",
    						"type" => "select",
    						'choices' => $categories_slider,
    						"section" => "themeZee_frontpage_posts");
    
    		return $themezee_settings;
    	}

    Function to call that query (functions.php)

    // Retrieve Frontpage Posts Query
    function themezee_frontpage_posts_query($paged) {
    
    	// Get Query Arguments
    	$options = get_option('zeedynamic_options');
    	$frontpage_posts_category = $options['themeZee_frontpage_posts_category'];
    
    	$query_arguments = array(
    		'post_type' => 'post',
    		'post_status' => 'publish',
    		'ignore_sticky_posts' => true,
    		'posts_per_page' => 4,
    		'paged' => $paged,
    		'orderby' => 'date',
    		'order' => 'DESC',
    		'category_name' => $frontpage_posts_category
    		);
    
    	$zee_frontpage_posts_query = new WP_Query($query_arguments);
    
    	return $zee_frontpage_posts_query;
  2. alchymyth
    Forum Moderator
    Posted 10 months ago #

    please post in the theme's forum http://wordpress.org/support/theme/zeedynamic

Reply

You must log in to post.

About this Topic