custom-post-type

Wordpress multiple template for same category with different custom post type

时光怂恿深爱的人放手 提交于 2021-02-11 15:36:10
问题 I have this structure for my Wordpress site : Custom post type 1 Category a Term a-1 Term a-2 ... Custom post type 2 Category a (same category than CPT 1) Term a-1 Term a-2 ... I would like to have different template for "Category a" archive page and single term page depending of current post type. How can I achieve this? In other words, I want these URLs each have their own template : http://www.example.com/custom-post-type-1/category-a/ http://www.example.com/custom-post-type-1/category-a

Wordpress multiple template for same category with different custom post type

不问归期 提交于 2021-02-11 15:34:24
问题 I have this structure for my Wordpress site : Custom post type 1 Category a Term a-1 Term a-2 ... Custom post type 2 Category a (same category than CPT 1) Term a-1 Term a-2 ... I would like to have different template for "Category a" archive page and single term page depending of current post type. How can I achieve this? In other words, I want these URLs each have their own template : http://www.example.com/custom-post-type-1/category-a/ http://www.example.com/custom-post-type-1/category-a

Wordpress: How to make unique field with ACF and custom post type

牧云@^-^@ 提交于 2021-02-11 01:59:17
问题 So I'm working on a custom post type to work together with Advanced custom fields. And I have this little script that is supposed to block duplicate emails from being entered. But the script does not work as I want it to. The code that u see below is for the custom post type page that I've linked to ACF. function init_members() { $labels = array( 'name' => 'Members', 'singular_name' => 'Member', 'menu_name' => 'Members', 'name_admin_bar' => 'Member', 'add_new' => 'New member', 'add_new_item'

Wordpress: How to make unique field with ACF and custom post type

会有一股神秘感。 提交于 2021-02-11 01:57:54
问题 So I'm working on a custom post type to work together with Advanced custom fields. And I have this little script that is supposed to block duplicate emails from being entered. But the script does not work as I want it to. The code that u see below is for the custom post type page that I've linked to ACF. function init_members() { $labels = array( 'name' => 'Members', 'singular_name' => 'Member', 'menu_name' => 'Members', 'name_admin_bar' => 'Member', 'add_new' => 'New member', 'add_new_item'

Timber pagination with custom post type

安稳与你 提交于 2021-02-08 09:42:49
问题 I am trying to use the example shown in the Timber docs for pagination with a custom post type. This is not working as I'd expect. The only way I've gotten a pagination to output is to add query_posts($args); after I set up my query $args and before I pass them into a new Timber\PostQuery but from everything I've read, I shouldn't be doing this. I have read this issue thread, but it seems to rely on using WP_Query directly, and I'm trying to keep this task as simple as possible. Any tips

Timber pagination with custom post type

纵然是瞬间 提交于 2021-02-08 09:41:41
问题 I am trying to use the example shown in the Timber docs for pagination with a custom post type. This is not working as I'd expect. The only way I've gotten a pagination to output is to add query_posts($args); after I set up my query $args and before I pass them into a new Timber\PostQuery but from everything I've read, I shouldn't be doing this. I have read this issue thread, but it seems to rely on using WP_Query directly, and I'm trying to keep this task as simple as possible. Any tips

Woocommerce products editable by their author for specific user role

泪湿孤枕 提交于 2021-02-08 04:17:12
问题 I have different users registered on my WordPress website with different roles. Apart from the rest of users, I want to allow advertisers (users with advertiser role - advertiser is a custom role that I have created) to place their own products on my site and also manage them. But they need to be limited only to manage (create, edit and delete) their own products, not of others. So far, I have tried the following code but it seems to be not valid. I am sure I can accomplish my goal using pre

Why am I getting a 404 error when trying to reach the taxonomy.php page without any terms, (Wordpress don't see taxonomy page)

一曲冷凌霜 提交于 2021-02-05 07:09:23
问题 I'm trying to create taxonomy page so I created taxonomy with taxonomie taxonomy-nowe.php but my WP don't see the page or I mess something with the rewrite URL? Can someone check my code and see if something I'm doing wrong. I did the flush the permalinks by save the Plain and then return to Post name permalinks. But I get not result. I want to achive somethink like this: domain.pl/oferta/kopiarki/nowe // custom post type function td_devices_posttype() { $labels = array( 'name' => _x(

Why am I getting a 404 error when trying to reach the taxonomy.php page without any terms, (Wordpress don't see taxonomy page)

倖福魔咒の 提交于 2021-02-05 07:07:16
问题 I'm trying to create taxonomy page so I created taxonomy with taxonomie taxonomy-nowe.php but my WP don't see the page or I mess something with the rewrite URL? Can someone check my code and see if something I'm doing wrong. I did the flush the permalinks by save the Plain and then return to Post name permalinks. But I get not result. I want to achive somethink like this: domain.pl/oferta/kopiarki/nowe // custom post type function td_devices_posttype() { $labels = array( 'name' => _x(

How to change slug in wordpress?

走远了吗. 提交于 2021-01-28 08:06:15
问题 I have this URL for my Resort page page-resorts.php : http://localhost/testwordpress/resorts/ After clicking the link to a post under Resort custom page I will have this URL for my custom page template (CPT) single-resort.php : http://localhost/testwordpress/resort/kurumba-maldives/ As you can see the resorts was changed to resort because I can't use resorts slug for the slug post. How can I achive this kind of URL: http://localhost/testwordpress/resorts/kurumba-maldives/ where the resorts