mgsisk / webcomic

Comic publishing power for the web. Turn your WordPress-powered site into a comic publishing platform with Webcomic.
http://wordpress.org/plugins/webcomic
GNU General Public License v2.0
110 stars 29 forks source link

Link to Last Webcomic in Collection (Gutenberg) #345

Closed reccanti closed 2 years ago

reccanti commented 4 years ago

Thanks for the great plugin! Apologies if this is answered somewhere in the docs, I've been having trouble finding a solution that works. I'm looking for examples of what I need to do (if there's a way to do this in the Gutenberg editor) or a place to start (if there isn't).

Expected Behavior

I'm looking to create a hardcoded link to the latest webcomic in a collection. The theme I'm uses the Gutenberg editor. I'd expect to be able to insert a shortcode or a widget from the Gutenberg block menu, or to be able to have a link like /mycomic/latest that would link to the latest comic in a collection, but so far I've been unable to come up with a method that works.

Current Behavior

Currently, I'm unable to find any way to get a link to the latest comic in the collection. Most of the documentation in the Wiki either doesn't seem to work the way I'd expect ([last_webcomic_link](https://github.com/mgsisk/webcomic/wiki/last_webcomic_link__ shortcode)) or I can't figure out how to apply it in the Gutenberg editor (last_webcomic_link widget)

Context

I have a landing page that links to several different projects. In one of them (Sketches) I'd like to have a link to the last sketch I uploaded.

Screenshot of my home page

Example

Environment

reccanti commented 4 years ago

Update: I seem to have been able to get it working using the following shortcode block:

_[last_webcomic_link post="86" args="relation='last'"]See Latest[/last_webcomiclink]

Where post="86" refers to the first post in the collection. Seems good for now, but a little hacky. Is there a more intuitive way of doing this? Also, would it be possible to update some of the wiki entries with examples?

visceralrose commented 4 years ago

Sorry to hijack this but I'm having this same problem and can't find a solution anywhere...

Ever since changing my webcomic's home page to a static page, my 'latest' links completely stopped working... They all direct to the home page, so I guess I did something wrong?

A short code won't work for my menu ( I don't think ) so a url to use would be ideal...! I can't figure it out at all...

tehandeh commented 4 years ago

Maybe this might help as a work around? Shortcode in menus

visceralrose commented 4 years ago

Maybe this might help as a work around? Shortcode in menus

Giving it a try now! Thanks!