Jump to content
Sign in to follow this  
bizint

First post not full width in magazine mode when specified

Recommended Posts

bizint

Hi! In Post options I chose magazine mode (not blog) with one to display full width. But I'm getting 5 half width? I've specified one full width post at the top? http://www.businessinteriors.co.uk/betatest/wordpress/office-design-news/office-fit-out-and-refurbishment-news/ Also can you change the number of posts displayed? Lets say I wanted 6 in magazine mode say for one page? Thanks, James

Share this post


Link to post
Share on other sites
kastelic
can you paste your platformbase/functions.php here?

Share this post


Link to post
Share on other sites
bizint
Yes sure...ummm how do I do that? Hang on.....ah ha! require_once(STYLESHEETPATH . "/advanced.php"); // ==================================================== // = YOUR FUNCTIONS - Where you should add your code = // ==================================================== // ADDING CUSTOM SECTIONS ------- // // Register a Drag&Drop HTML Section for the admin. // A pullquote section was created here for demonstration purposes // Sections should be named: section.[your section name].php and placed in the sections folder. function base_sections(){ /* Your custom sections get registered in here... PageLines Register Section Arguments: 1. Section Class Name, 2. Directory name (or filename if in root of 'sections' folder), 3. Init Filename (if different from directory name), 4. Section setup and variable array */ pagelines_register_section('BasePullQuote', 'pullquote', null, array('child' => true) ); pagelines_register_section('BaseSidebar','sb_base', null, array('child' => true) ); } // ABOUT HOOKS --------// // Hooks are a way to easily add custom functions and content to the Platform theme. There are hooks placed strategically throughout the theme // so that you insert code and content with ease. // HOOKS EXAMPLE --------// // Below is an example of how you would add a social media icon to the icons in header (branding section) // We have placed a hook at the end of the icon set specifically add new icons without modifying code or having to worry about your edits // getting thrown out during the upgrade process. The way to use hooks goes a little like this: // add_action('hook_name','function name'); // ---> uncomment to load //add_action('pagelines_branding_icons_end', 'add_icons_to_branding'); // function name function add_icons_to_branding(){ // This hook adds a stumbleupon icon to the header of your theme. The class referenced in the link can be seen in the style.css // and is the image from the CSS is placed in the images folder ?> array( 'name' => 'Ubuntu', 'family' => '"Ubuntu", arial, serif', 'web_safe' => true, 'google' => true, 'monospace' => false ) ); return array_merge( $thefoundry, $myfont ); } // ADDING NEW TEMPLATES --------// // Want another page template for drag and drop? Easy :) // 1. Add File called page.[page-id].php to Base // 2. Add /* Template Name: Your Page Name */ and Call to 'setup_pagelines_template();' to that file (see page.base.php) // 3. Add 'pagelines_add_page('[page-id]', '[Page Name]');' to this functions.php file // Add Base Page if ( function_exists( 'pagelines_add_page' ) ) pagelines_add_page('base', 'Custom Page'); // Goldbyte - Case Study if ( function_exists( 'pagelines_add_page' ) ) pagelines_add_page('casestudy', 'Case Study Overview'); // OVERRIDE SECTION TEMPLATES --------// // Want more customization control over any of the core section templates in PlatformPro? Just override the template file. // To do that, just add a file called template.[section-id].php to this child theme and it will override the section templates // for the section with that ID. For example, template.boxes.php will override the boxes templates. // Once overridden you can copy the code from that section, paste it there and edit to your heart's content. // CASE STUDY SECTION IMPLEMENTATION --------// // We'll add a custom post type for the case studies including some custom taxonomies // Code by M.Falkus - goldbyte.co.uk - 15.07.2011 add_action( 'init', 'create_post_type' ); function create_post_type() { register_post_type( 'bi_case_study', array( 'labels' => array( 'name' => __( 'Case Studies' ), 'singular_name' => __( 'Case Study' ), 'add_new' => __('Add New', 'bi_case_study'), 'add_new_item' => __('Add New Case Study'), 'edit_item' => __('Edit Case Study'), 'new_item' => __('New Case Study'), 'view_item' => __('View Case Study'), 'search_items' => __('Search Case Studies'), 'not_found' => __('No case studies found'), 'not_found_in_trash' => __('No case studies found in Trash'), 'parent_item_colon' => '', 'menu_name' => 'Case Studies' ), 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'query_var' => true, 'rewrite' => array('slug' => 'case-studies'), 'capability_type' => 'post', 'has_archive' => true, 'hierarchical' => false, 'menu_position' => null, 'supports' => array('title','editor','thumbnail','excerpt') ) ); } //hook into the init action and call create_case_study_taxonomies when it fires add_action( 'init', 'create_case_study_taxonomies', 0 ); //create taxonomies style and industry for the post type "bi_case_study" function create_case_study_taxonomies() { // Add new taxonomy, NOT hierarchical (like tags), used for interior style $labels = array( 'name' => _x( 'styles', 'taxonomy general name' ), 'singular_name' => _x( 'Style', 'taxonomy singular name' ), 'search_items' => __( 'Search Styles' ), 'popular_items' => __( 'Popular Styles' ), 'all_items' => __( 'All Styles' ), 'parent_item' => null, 'parent_item_colon' => null, 'edit_item' => __( 'Edit Style' ), 'update_item' => __( 'Update Style' ), 'add_new_item' => __( 'Add New Style' ), 'new_item_name' => __( 'New Style Name' ), 'separate_items_with_commas' => __( 'Separate styles with commas' ), 'add_or_remove_items' => __( 'Add or remove styles' ), 'choose_from_most_used' => __( 'Choose from the most used styles' ), 'menu_name' => __( 'Styles' ), ); register_taxonomy('styles','bi_case_study',array( 'hierarchical' => false, 'labels' => $labels, 'show_ui' => true, 'query_var' => true, 'rewrite' => array( 'slug' => 'styles' ), )); // Add new taxonomy, NOT hierarchical (like tags), used for interior style $labelsTwo = array( 'name' => _x( 'industry', 'taxonomy general name' ), 'singular_name' => _x( 'Industry', 'taxonomy singular name' ), 'search_items' => __( 'Search Industries' ), 'popular_items' => __( 'Popular Industries' ), 'all_items' => __( 'All Industries' ), 'parent_item' => null, 'parent_item_colon' => null, 'edit_item' => __( 'Edit Industry' ), 'update_item' => __( 'Update Industry' ), 'add_new_item' => __( 'Add New Industry' ), 'new_item_name' => __( 'New Industry Name' ), 'separate_items_with_commas' => __( 'Separate industries with commas' ), 'add_or_remove_items' => __( 'Add or remove industries' ), 'choose_from_most_used' => __( 'Choose from the most used industries' ), 'menu_name' => __( 'Industries' ), );

Share this post


Link to post
Share on other sites
bizint
I could only do the top bit... so her is the bottom: register_taxonomy('styles','bi_case_study',array( 'hierarchical' => false, 'labels' => $labels, 'show_ui' => true, 'query_var' => true, 'rewrite' => array( 'slug' => 'styles' ), )); // Add new taxonomy, NOT hierarchical (like tags), used for interior style $labelsTwo = array( 'name' => _x( 'industry', 'taxonomy general name' ), 'singular_name' => _x( 'Industry', 'taxonomy singular name' ), 'search_items' => __( 'Search Industries' ), 'popular_items' => __( 'Popular Industries' ), 'all_items' => __( 'All Industries' ), 'parent_item' => null, 'parent_item_colon' => null, 'edit_item' => __( 'Edit Industry' ), 'update_item' => __( 'Update Industry' ), 'add_new_item' => __( 'Add New Industry' ), 'new_item_name' => __( 'New Industry Name' ), 'separate_items_with_commas' => __( 'Separate industries with commas' ), 'add_or_remove_items' => __( 'Add or remove industries' ), 'choose_from_most_used' => __( 'Choose from the most used industries' ), 'menu_name' => __( 'Industries' ), ); register_taxonomy('industry','bi_case_study',array( 'hierarchical' => false, 'labels' => $labelsTwo, 'show_ui' => true, 'query_var' => true, 'rewrite' => array( 'slug' => 'industry' ), )); } /** For the case study search **/ function dropdown_tag_cloud( $args = '' ) { $defaults = array( 'smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'csPostType' => 45, 'format' => 'flat', 'orderby' => 'name', 'order' => 'ASC', 'exclude' => '', 'include' => '', 'taxonomy' => 'styles' ); $args = wp_parse_args( $args, $defaults ); $tags = get_tags( array_merge($args, array('orderby' => 'count', 'order' => 'DESC')) ); // Always query top tags if ( empty($tags) ) return; $return = dropdown_generate_tag_cloud( $tags, $args ); // Here's where those top tags get sorted according to $args if ( is_wp_error( $return ) ) return false; else echo apply_filters( 'dropdown_tag_cloud', $return, $args ); } function dropdown_generate_tag_cloud( $tags, $args = '' ) { global $wp_rewrite; $defaults = array( 'smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'csPostType' => 45, 'format' => 'flat', 'orderby' => 'name', 'order' => 'ASC' ); $args = wp_parse_args( $args, $defaults ); extract($args); if ( !$tags ) return; $counts = $tag_links = array(); foreach ( (array) $tags as $tag ) { $counts[$tag->name] = $tag->count; $tag_links[$tag->name] = get_tag_link( $tag->term_id ); if ( is_wp_error( $tag_links[$tag->name] ) ) return $tag_links[$tag->name]; $tag_ids[$tag->name] = $tag->term_id; } $min_count = min($counts); $spread = max($counts) - $min_count; if ( $spread <= 0 ) $spread = 1; $font_spread = $largest - $smallest; if ( $font_spread <= 0 ) $font_spread = 1; $font_step = $font_spread / $spread; // SQL cannot save you; this is a second (potentially different) sort on a subset of data. if ( 'name' == $orderby ) uksort($counts, 'strnatcasecmp'); else asort($counts); if ( 'DESC' == $order ) $counts = array_reverse( $counts, true ); $a = array(); $rel = ( is_object($wp_rewrite) && $wp_rewrite->using_permalinks() ) ? ' rel="tag"' : ''; foreach ( $counts as $tag => $count ) { $tag_id = $tag_ids[$tag]; $tag_link = clean_url($tag_links[$tag]); $tag = str_replace(' ', ' ', wp_specialchars( $tag )); $a[] = "t"; } switch ( $format ) : case 'array' : $return =& $a; break; case 'list' : $return = "
    nt
  • "; $return .= join("
  • nt
  • ", $a); $return .= "
  • n
n"; break; default : $return = join("n", $a); break; endswitch; return apply_filters( 'dropdown_generate_tag_cloud', $return, $tags, $args ); } function case_study_widgets_init() { // Lets setup a new sidebar just for the case study section register_sidebar( array( 'name' => __( 'Case Study Sidebar', 'PlatformBase' ), 'id' => 'case-study-widget-area', 'description' => __( 'The widget area used on the case study listings sidebar.', 'PlatformBase' ), 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', ) ); } // Register sidebars for the case study sections by running case_study_widgets_init() on the widgets_init hook. */ add_action( 'widgets_init', 'case_study_widgets_init' ); // Add a function to show the submenu for a sidebar widget when the widget hasn't been called function caseStudySubMenu(){ $postToGet = '1896'; $rootPost = get_post($postToGet); $title = $rootPost->post_title; echo '
  • '; echo '
    '; echo '

    '; echo ''.$title.'

    '; echo '
      '; if ($rootPost->ID == '1896'){ $output = '
    • '."Case Studies".'
    • '.$output; } //$output = '
    • '.$parentIcon.' '.$parentTitle.'
    • '.$output; $output = $output.wp_list_pages('sort_column=menu_order&depth=1&title_li=&echo=0&child_of='.$rootPost->ID); echo $output; echo '
  • '; } ?>

    Share this post


    Link to post
    Share on other sites
    Danny
    Hi Bizint, When it comes to this type of code, I ain't so clever, but to make it easier for Kastelic or one of the other support mods I have added your code to this link. It will make it easier to read. http://pastie.org/2846025

    Please search our forums, before posting!

    Share this post


    Link to post
    Share on other sites
    Jenny
    In PlatformPro -> Blog and Posts, "Post Layout Mode" should be set to magazine, "Number of Full Width Posts?" should be set to 1. In Wordpress -> Settings -> Reading, "Blog pages show at most" should be set to at least 6.

    Jenny :: Web designer at Simple Mama (follow me at @simplemamacom)

    Check out Share Me, a social sharing add-on for DMS that is super simple to set up.

    Share this post


    Link to post
    Share on other sites
    bizint
    Hi Jenny...yup done that...its showing six but when I put full width posts one...I dont get any...def not settings, not sure why its doing this...

    Share this post


    Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

    Sign in to follow this  

    ×