开发者 | ldebrouwer |
---|---|
更新时间 | 2012年4月19日 20:26 |
捐献地址: | 去捐款 |
PHP版本: | 3.3 及以上 |
WordPress版本: | 3.4 |
affiliate-press
folder to the /wp-content/plugins/
directoryAffiliate Press
menu that appears in your admin menuYou can do this by copying the following PHP code in your product template. if( class_exists( 'LDB_Affiliate_Press' ) ) { $ap = new LDB_Affiliate_Press; echo $ap->AP_getPrices( true ); } To load the products into a page template you can use this code. $posts = get_posts( array( 'post_type' => 'product' ) ); foreach( $posts as $post ) { setup_postdata( $post ); the_title(); the_post_thumbnail(); the_content(); if( class_exists( 'LDB_Affiliate_Press' ) ) { $ap = new LDB_Affiliate_Press; echo $ap->AP_getPrices( true ); } } If you'd rather retrieve just the data and not the pre-formatted table you can use the following code. if( class_exists( 'LDB_Affiliate_Press' ) ) { $ap = new LDB_Affiliate_Press; $data = $ap->AP_getPrices(); } The affiliate data is now stored in the $data variable.
By default custom post types are not shown on a category page. To achieve this you'll have to add something along the lines of the code below to your themes' function.php. add_filter( 'pre_get_posts', 'my_get_posts' ); function my_get_posts( $query ) { if ( is_category() && $query->is_main_query() ) $query->set( 'post_type', array( 'post', 'product' ) ); return $query; }
The permissions on you 'uploads' folder in 'wp-content' are most likely not set correctly.
This plugin is still under development and in beta. Most of the functionality is still subject to change and I hope to bring some more features to the plugin. Compiling an extensive help and support section would therefor be somewhat of a hassle at the moment. I strongly advise you to post in the support forums if you have any questions. ( And please check there first if your question wasn't answered yet. )