Procházet zdrojové kódy

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

tags/0.9.0
j před 5 roky
rodič
revize
be7b70831d

+ 2
- 0
plugins/cia-endpoints/includes/formats.php Zobrazit soubor

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

+ 4
- 0
vue-theme/functions.php Zobrazit soubor

@@ -167,6 +167,10 @@ add_action( 'wp_enqueue_scripts', 'webapptiv_remove_block_library_css' );
167 167
 // header( 'Access-Control-Allow-Origin: http://localhost:8080' );
168 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 174
 // function artists_types() {
171 175
 //     p2p_register_connection_type( array(
172 176
 //         'name' => 'artists_to_episodes',

Načítá se…
Zrušit
Uložit