Categories
CMS Mastering Development Wordpress

Don’t know why post meta doesn’t work even no error is thrown

I am having a problem with post meta. I have a custom meta box for posts. But when I select the option it doesn’t work. Neither does this code throw any error. One week ago it worked like charm. Here is all the code I use. add_action( ‘add_meta_boxes’, ‘themeo_inpost_layout_box’ ); function themeo_inpost_layout_box() { if ( […]

Categories
CMS Mastering Development Wordpress

How to exclude attachments from search query?

I have issue getting my code works to exclude attachments from the search query. I am adapting the Search Query to handle _sku value from WooCommerce but it also search for posts.post_type attachment even if I ask to only search in post, page, product type. The problem is that my attachment (images) linked to the […]

Categories
CMS Mastering Development Wordpress

How to exclude specific post_type from default search?

I’m trying to exclude WooCommerce products from default WP search, but I need to keep all other posts types, including CPT and those CPT created in the future. Im trying with: function searchFilter($query) { if (!$query->is_admin && $query->is_search) { $query->set(‘post_type’, array(‘post’, ‘page’, ‘CPT’)); } return $query; } add_filter(‘pre_get_posts’, ‘searchFilter’); In code above I can set […]

Categories
CMS Mastering Development Wordpress

How to save and retrieve the metabox select options values

I am facing a problem with my metabox dropdown list populated with custom post types, i am unable to save and display the selected option and when i checked by enabling custom fields from the screen options, i can see the correct value in to custom field. The only problem is, i am not getting […]

Categories
CMS Mastering Development Wordpress

Notice: Trying to get property ‘term_id’ of non-object

I receive the error on taxonomy page in wp-admin.Before this error, I had problem that couldnt add the taxonomy to menu because of my taxonomy code.I fixed the code then the current error became.So, How to fix it? Thanks Notice: Trying to get property ‘term_id’ of non-object in /home/deniztas/oneclick.deniz-tasarim.site/wp-admin/includes/class-wp-terms-list-table.php on line 420 Notice: Trying to […]

Categories
CMS Mastering Development Wordpress

Invalid Menu Items

I registered a taxonomy named districts, but when I add districts to nav menus, the nav menu items are invalid! Here is the code that registers the taxonomy: function masallah() { // Add new taxonomy, make it hierarchical like categories //first do the translations part for GUI $labels = array( ‘name’ => _x( ‘Districts’, ‘taxonomy […]

Categories
CMS Mastering Development Wordpress

Invalid Menu Items [duplicate]

https://youtu.be/lME3lY-kNbA I told the question on youtube video also I tell the question here again: I cant add my taxonomies to menu except 000 taxonomy.I dont know why but it works: the error : invalid items… ( red showing as you can see on youtube video ) this one works: function deneme() { // Add […]

Categories
CMS Mastering Development Wordpress

Invalid Menu Items – The most interesting question

The question needs it so I captured the error.It is necessary so please watch it. https://youtu.be/lME3lY-kNbA if it doesnt open, please try this: https://www.youtube.com/watch?v=lME3lY-kNbA&feature=youtu.be I told the question on youtube video so I share only the code like what I said on video. I hear that video,video,video are you youtuber? 😀 no, it needed this […]

Categories
CMS Development Wordpress

Notice: Undefined property: WP_Error::$name

Latest edit: I opened my youtube chanell for error videos 🙂 They dont be end.If you want to see my killer errors, you can subscribe it 😛 Here is the error: https://youtu.be/wAI4QLlpqDY also ı changed the codes so new codes: //adding taxonomy //hook into the init action and call create_book_taxonomies when it fires add_action( ‘init’, […]

Categories
CMS Development Wordpress

WordPress Custom Post Status not Public but Viewable Through Link: Privately Published Posts

I have been working on my site to bring up private posts on my site. I built a custom post status for this purpose. My goal is to exclude posts belonging to that post status from search, from Blog Page, from WordPress Queries, RSS Feed etc. Basically there should be no mentions of it anywhere […]