Private
Public Access
1
0

bug fix for blogs without featured image

This commit is contained in:
Sander Roosendaal
2018-11-06 17:22:29 +01:00
parent 9f6c7357e0
commit 88d65b2819

View File

@@ -679,6 +679,7 @@ def get_blog_posts(request):
for postdata in blogs_json[0:3]: for postdata in blogs_json[0:3]:
try: try:
featuredmedia = postdata['featured_media'] featuredmedia = postdata['featured_media']
url = 'https://analytics.rowsandall.com/wp-json/wp/v2/media/%d' % featuredmedia url = 'https://analytics.rowsandall.com/wp-json/wp/v2/media/%d' % featuredmedia
@@ -695,6 +696,8 @@ def get_blog_posts(request):
][ ][
'source_url' 'source_url'
] ]
else:
image_url = ''
except KeyError: except KeyError:
image_url = '' image_url = ''