Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add post thumbnail support for v2. #37

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

samdotme
Copy link

Allowing users to get access to featured images in posts is a simple two line change. This will simply return an empty string for those posts/themes which do not have/support a featured image.

@@ -280,13 +280,14 @@ public function get_menu_location( $request ) {
$cache = array();

foreach ( $rev_items as $item ) :

$post_id = url_to_postid( $item->url );
Copy link
Author

@samdotme samdotme Nov 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why the spacing is off here. I'm using Atom, and it's formatted perfectly. Same for below.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is because of tabs vs spaces

@mckernanin
Copy link

I don't understand the reason behind this. The plugin just adds endpoints for menus. Can you explain?

@samdotme
Copy link
Author

@mckernanin The use case for this would be someone building a modern, tiled menu layout. An example of doing this with posts or categories would be https://wordpress.org/plugins/wp-tiles/.

Exposing the featured image from the menu endpoint would allow a theme designer to get the same effect using a menu, which has the benefits of your tiles not having to change with every new post.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants