WordPress.org

Ready to get started?Download WordPress

Forums

Features by WooThemes
Using different 'features' on different pages (4 posts)

  1. seanuk
    Member
    Posted 1 year ago #

    Firstly, overall this is a fantastic little plugin! Thank you :)

    I want to have a different set of features on two different pages, so I use the plugin as normal. How then can I have a different set of features on the other page ?

    I'm guessing I can use 'id' => 0 (display a specific item) but that would require calling the plugin for however many features I want on that page with the corresponding ID each time (not ideal) ?

    Is there a way of calling the plugin to run for X amount of items, but offset to the first ID of the set of features I want on that page ?

    http://wordpress.org/extend/plugins/features-by-woothemes/

  2. chump
    Member
    Posted 1 year ago #

    I am interested in this as well.

  3. Marcus03
    Member
    Posted 1 year ago #

    I am trying to do this too

  4. saxisme
    Member
    Posted 1 year ago #

    Hi,

    quite new in this coding, but this is what i came so far, and works for my needs.

    I created a custom taxonomy for the 'feature' custom post type.
    (I'm using Twentytwelve theme)

    Add this to your functions.php

    // Register Custom Taxonomy
    function Position()  {
    	$labels = array(
    		'name'                       => _x( 'Positions', 'Taxonomy General Name', 'twentytwelve' ),
    		'singular_name'              => _x( 'Position', 'Taxonomy Singular Name', 'twentytwelve' ),
    		'menu_name'                  => __( 'Genre', 'twentytwelve' ),
    		'all_items'                  => __( 'All Genres', 'twentytwelve' ),
    		'parent_item'                => __( 'Parent Genre', 'twentytwelve' ),
    		'parent_item_colon'          => __( 'Parent Genre:', 'twentytwelve' ),
    		'new_item_name'              => __( 'New Genre Name', 'twentytwelve' ),
    		'add_new_item'               => __( 'Add New Genre', 'twentytwelve' ),
    		'edit_item'                  => __( 'Edit Genre', 'twentytwelve' ),
    		'update_item'                => __( 'Update Genre', 'twentytwelve' ),
    		'separate_items_with_commas' => __( 'Separate genres with commas', 'twentytwelve' ),
    		'search_items'               => __( 'Search genres', 'twentytwelve' ),
    		'add_or_remove_items'        => __( 'Add or remove genres', 'twentytwelve' ),
    		'choose_from_most_used'      => __( 'Choose from the most used genres', 'twentytwelve' ),
    	);
    
    	$args = array(
    		'labels'                     => $labels,
    		'hierarchical'               => false,
    		'public'                     => true,
    		'show_ui'                    => true,
    		'show_admin_column'          => true,
    		'show_in_nav_menus'          => true,
    		'show_tagcloud'              => true,
    	);
    
    	register_taxonomy( 'feature-position ', 'feature', $args );
    }
    
    // Hook into the 'init' action
    add_action( 'init', 'Position', 0 );

    Then i added after line 403 in the file class-woothemes-features.php:
    $query_args['feature-position'] = $args['position'];

    The in the shortcode you can add the tag 'feature-position'=>'your custom position here'. This is my result:
    do_action( 'woothemes_features', array( 'limit' => 3, 'link_title' => true, 'per_row' => 3, 'size' => 150, 'position' => 'homepage' ) ); ?>

    Of course as soon as the plugin is updated it will overwrite this addition.
    At least it's a start.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.