categories

Obtain details of categories on a class at runtime?

自闭症网瘾萝莉.ら 提交于 2019-12-24 10:47:20
问题 In Objective-C, is there a way to list the categories on a particular class at runtime? With the Objective-C runtime functions I can obtain details for the class and instance methods, class hierarchy, instance variables, etc. but seemingly not the category information. Looking at F-Script, I see that it doesn't display category information (indeed, it appears not to display methods from categories at all). On the other hand, class-dump extracts category information but this is from the binary

iOS5, StoryBoards, ARC: Weird categories issue

跟風遠走 提交于 2019-12-24 10:36:34
问题 I've created a file with sql methods and now this file is really large. I'd like to split it for best practice and implementation simplicity. So, categories. I've created in xCode new objective-c categories file -> DBAccess+Generals.h (.m). .h: #import "DBAccess.h" @interface DBAccess (Generals) -(void)newMeth; @end .m #import "DBAccess+Generals.h" #import "DBAccess.h" @implementation DBAccess (Generals) -(void)newMeth { NSLog(@"New Meth"); } @end In DBAccess.h #import <Foundation/Foundation

WooCommerce - Conditional has_term doesn't work anymore after updating

情到浓时终转凉″ 提交于 2019-12-24 07:17:19
问题 So I'm using the conditional of tho code Snippet from this example, with this thread code with success: BUT It's no longer working after updating my WordPress Core and WooCommerce Plugin. if ( is_product() && has_term( 'sample-category', 'product_cat' ) ){ add_action( 'woocommerce_after_add_to_cart_button', 'add_custom_button', 10, 0 ); function add_custom_button() { global $products; $product_link = get_permalink( $products->id ); $sample_link = substr($product_link, 0, -1) . '-swatch-card/'

WordPress - Add/Edit Post Screen Options not showing Categories

泪湿孤枕 提交于 2019-12-24 01:17:31
问题 this is hopefully a very simple fix but i just noticed on my Add New/Edit Post Screen Options i don't have Categories to Enable/Disable (see pic). Any help muchos appreciated!! 回答1: in wp-admin/includes/screen.php we see: <div class="metabox-prefs"> <?php meta_box_prefs( $this ); // draw checkboxes in screen options ?> </div> and meta_box_prefs function takes in account the get_hidden_meta_boxes function: function meta_box_prefs( $screen ) { global $wp_meta_boxes; $hidden = get_hidden_meta

WordPress URL for showing post by both category and tag

谁都会走 提交于 2019-12-24 01:13:04
问题 How can I show all posts with a specific category foo and a specific tag bar by using URL? Example: site.com/category/foo/tag/bar or Example: site.com/posts?category={category-id}&tag={tag-id} 回答1: I don't know is there as default feature for the this or not but I have an idea as how to achieve it. You can create a custom template for this and in that template get the query string by get_query_var() and then use WP_Query cat and tag argument to fetch your posts belonging to that cat/tag. Here

How to add category to all post by using sql query?

房东的猫 提交于 2019-12-24 00:44:49
问题 I have a thousand posts and all them don't have category. So, Do you know how to associate category with all posts by using sql query ? Thank you ! 回答1: don't need to use mySql, you can do it with bulk actions in your wp admin Create your categories as usual. Go to your entries and select them all Select in bulk actions / edit Edit all at once. 回答2: First you need to know the id of you category you want your posts to be associated with. Look in the table wp_terms column term_id. INSERT INTO

Counting cart-items of specific product category

喜夏-厌秋 提交于 2019-12-23 20:03:39
问题 I am trying to get the number of items in the cart just from a specific product category in WooCommerce. I am doing a site for a winery. It has alcoholic and non-alcoholic products. All the wine falls under the main category of 'wine' or category id 34, with many subcategories and products underneath them. For any thing that falls under this category... I need to know how many items are in the cart under this category. If there are six bottles of wine no matter if they are all the same

MySQL: join many tables on one Statement

筅森魡賤 提交于 2019-12-23 17:55:19
问题 i have the following DB-Structure / hierarchy: TABLE product_type : id,name, .... TABLE product : id,parent_id, name, ... parent_id : is the product_type id TABLE treeNode : id, parent_id, name, type its a tree hierarchy (roots have n sub Nodes) the number of levels of hierarchy is unknown . the col type has the values "CATEGORY" OR "GROUP" , that means, i have 2 trees: Categories: TreeNode 1 sub 1.1 sub.1.1.1 sub.1.1.2 .... sub 1.2 sub.1.2.1 sub.1.2.2 .... TreeNode 2 sub 2.1 sub.2.1.1 sub.2

Hiding main category title on a unique category archive page

依然范特西╮ 提交于 2019-12-23 15:54:23
问题 I'm building a site with many different categories and need to simply remove the category titles on just one archive page: http://redyearclients.co.uk/PandF/product-category/exterior-paving/paving-brands/ I've discovered methods of removing the title from all pages, but I need all other category pages to require the title, this page for example should stay as it looks now: http://redyearclients.co.uk/PandF/product-category/exterior-paving/ Any help massively appreciated. 回答1: For that purpose

Can't get category object in some templates of WooCommerce

一个人想着一个人 提交于 2019-12-23 12:31:58
问题 I'm using get_category() to get the category object by its ID. Here category 39 is child of category 37 . For example, Courses (37) - Programming (39) My problem is that, if I use get_category(37 or 39) in functions.php BOTH will return null . If I use get_category(37 or 39) in single-product.php 37 (the root category) will return null. If I use this same call in add-to-cart/simple.php both will return an Object. WooCommerce functions will be called first, and then single-product.php and then