Selaa lähdekoodia

:sparkles: #44 | added feature image support to theme | added feature image url to api

tags/0.9.0
j 5 vuotta sitten
vanhempi
commit
be7b70831d
2 muutettua tiedostoa jossa 6 lisäystä ja 0 poistoa
  1. 2
    0
      plugins/cia-endpoints/includes/formats.php
  2. 4
    0
      vue-theme/functions.php

+ 2
- 0
plugins/cia-endpoints/includes/formats.php Näytä tiedosto

17
     $filtered[excerpt] = $item->post_excerpt;
17
     $filtered[excerpt] = $item->post_excerpt;
18
     $filtered[date] = $item->post_date;
18
     $filtered[date] = $item->post_date;
19
     $filtered[content] = $item->post_content;
19
     $filtered[content] = $item->post_content;
20
+    $filtered[featured] = get_the_post_thumbnail_url($item);
21
+
20
 
22
 
21
 
23
 
22
     // Materials + type endpoints
24
     // Materials + type endpoints

+ 4
- 0
vue-theme/functions.php Näytä tiedosto

167
 // header( 'Access-Control-Allow-Origin: http://localhost:8080' );
167
 // header( 'Access-Control-Allow-Origin: http://localhost:8080' );
168
 header( 'Content-Type: application/json' );
168
 header( 'Content-Type: application/json' );
169
 
169
 
170
+// Add featured image support
171
+function craft_post_thumbnails() { add_theme_support( 'post-thumbnails' ); }
172
+add_action( 'after_setup_theme', 'craft_post_thumbnails' );
173
+
170
 // function artists_types() {
174
 // function artists_types() {
171
 //     p2p_register_connection_type( array(
175
 //     p2p_register_connection_type( array(
172
 //         'name' => 'artists_to_episodes',
176
 //         'name' => 'artists_to_episodes',

Loading…
Peruuta
Tallenna