Categories
CMS Mastering Development Wordpress

Beautify Feed URL for custom post type

I have news custom post type and I use this URL to check the news feed http://website.com/feed/?post_type=news Is There a way to change it to : http://website.com/news/feed/ <?php function news_post_type() { $labels = array( …. ); $rewrite = array( ‘slug’ => ‘news’, ‘with_front’ => true, ‘pages’ => true, ‘feeds’ => true, ); $args = array( […]

Categories
CMS Mastering Development Wordpress

Action on Custom Post publish

I want to send a push notification when a custom post is published ( send in both publish or updated) I tried this code to create a custom post and send a notification. <?php /* Plugin Name: Send Notification CPT Description: Declares a plugin that will create a custom post type to send notifications. Version: […]

Categories
CMS Mastering Development Wordpress

Don’t know how to show custom taxonomies from a custom post_type

I created a custom post_type called Events, where I can show the Events(URL:HTTP://localhost.com/events) that are load by the archive-events.php that I created. Now I have created a custom taxonomy called counties that I want to use to filter Events by the county in which they are located. I’m able to apply counties to specific Events, […]

Categories
CMS Mastering Development Wordpress

How can i stop woocommerce checkout event based on api request result?

I’m building a custom woocommerce payment gateway and the following code is running on the woocommerce checkout page, and I’m trying to prevent the user from submitting the order till he writes his credit card details in the Tap payment gateway (card js) form. if the user wrote his card details correctly a request will […]

Categories
CMS Mastering Development Wordpress

Weird query with get_posts and WP_Query

Attempting to make a search in a custom post type "comunicados" inside a shortcode in a custom plugin I send this to get_posts() Array ( [posts_per_page] => -1 [post_type] => comunicados [post_status] => publish [orderby] => title [order] => DESC [s] => co ) Here the actual code //QUERY $opt = array( ‘posts_per_page’ => -1, […]

Categories
CMS Mastering Development Wordpress

Pagination custom post type not working with rewrite slug

I can’t find the way of making my pagination to work on my post type (this is not on an archive-posttype.php). I’ve rewrited my post type, but the second page isn’t working if I do the rewriting ("medias/actualites"), but it works if I have the non-rewrited slug ("actualite"). I do the rewrite because my client […]

Categories
CMS Mastering Development Wordpress

Custom post type author issues

I’ve created a CPT called ‘artigos’ (articles), which supports title, editor, thumbnail and author. I can see and choose the author of the post, but in the users screen, the number of posts assigned to an author doesn’t change, and the author page can’t find the articles. Am I missing something? function custom_post_type_artigos() { $labels […]

Categories
CMS Mastering Development Wordpress

Custom post type permalin return bad url

I have problem with custom post type. In BO url’s are ok example: page.pl/post_type_name/post_title When I try use get_the_permalink(); or the_permalink it return url like: /?post_type=cpt_wydarzenia&p=258" Code: $args = array( "label" => __( "Wydarzenia", "vilo" ), ‘labels’ => $labels, ‘hierarchical’ => false, ‘supports’ => array(‘title’, ‘editor’), //’taxonomies’ => array( ‘category’, ‘post_tag’ ), ‘public’ => true, […]

Categories
Mastering Development

Query set for a pie-chart

I think I am just making a simple error here, but I can’t seem to solve it. I am trying to create some fake data and analyze through different types of users which I will then put into a pie chart. Here is my models.py: from django.db import models import factory import factory.django import factory.fuzzy […]

Categories
CMS Mastering Development Wordpress

Category permalinks don’t work even after flushing

I have created a custom post type (portfolio) and I’m using the built-in Category taxonomy with it. When I view the category archives page, only regular posts are showing under the category, my custom posts aren’t there at all. The options to select categories are there in the Edit Post page (and Quick Edit), they […]