Parcourir la source

:recycle: changing custom types to ignore permalink front matter | altering routes to recognize blog

tags/0.9.0
J il y a 4 ans
Parent
révision
4efd49866e

+ 4
- 0
plugins/cia-post-types/cia-post-types.php Voir le fichier

@@ -55,6 +55,10 @@ class PostType {
55 55
             'has_archive'        => false,
56 56
             'show_in_rest'       => true,
57 57
             'publicly_queryable' => true, // Needed for slug
58
+            'rewrite'            => array( // Rewrite permalink stuff
59
+                'slug' => ucfirst($this->post_type),
60
+                'with_front' => false
61
+            ),
58 62
         ];
59 63
 
60 64
         register_post_type( $this->post_type, $args );

+ 2
- 1
vue-theme/src/components/navigation/navigation.vue Voir le fichier

@@ -48,7 +48,7 @@ export default {
48 48
          */
49 49
         const menuItems = computed(() => {
50 50
             const extras = [
51
-                // 'center',
51
+                'blog',
52 52
                 // 'education',
53 53
                 // 'resources',
54 54
                 // 'support',
@@ -57,6 +57,7 @@ export default {
57 57
             ]
58 58
             const ignore = [
59 59
                 'page',
60
+                'post',
60 61
                 'sticky',
61 62
             ]
62 63
             const filtered = postTypes.filter(val => !ignore.includes(val))

+ 1
- 1
vue-theme/src/pages/list.vue Voir le fichier

@@ -55,7 +55,7 @@ export default {
55 55
     },
56 56
     computed: {
57 57
         type() {
58
-            return this.$route.params.type
58
+            return postTypes.includes(this.$route.params.type) ? this.$route.params.type : 'post'
59 59
         },
60 60
         sortBy() {
61 61
             return this.$route.params.sortBy

+ 1
- 1
vue-theme/src/pages/single.vue Voir le fichier

@@ -64,7 +64,7 @@ export default {
64 64
     },
65 65
     computed: {
66 66
         type() {
67
-            return this.$route.params.type
67
+            return postTypes.includes(this.$route.params.type) ? this.$route.params.type : 'post'
68 68
         },
69 69
         slug() {
70 70
             return this.$route.params.slug

+ 9
- 3
vue-theme/src/router/routes.js Voir le fichier

@@ -3,17 +3,23 @@ import listPage from '@/pages/list.vue'
3 3
 import singlePage from '@/pages/single.vue'
4 4
 
5 5
 export default [
6
-    // Home Page
6
+    /**
7
+     * Home Page
8
+     */
7 9
     { path: '/', component: indexPage },
8 10
 
9
-    // List Pages
11
+    /**
12
+     * List Pages
13
+     */ 
10 14
     { path: '/:type', component: listPage },
11 15
     {
12 16
         path: '/:type/sorted/:sortBy',
13 17
         component: listPage,
14 18
     },
15 19
     
16
-    // Single Pages
20
+    /**
21
+     * Single Pages
22
+     */ 
17 23
     {
18 24
         path: '/:type/:slug',
19 25
         component: singlePage,

Chargement…
Annuler
Enregistrer