osompress / genesis-portfolio-pro

Plugin: Genesis Portfolio Pro
24 stars 14 forks source link

Add Portfolio widget #13

Closed nickcernis closed 6 years ago

nickcernis commented 7 years ago

We are regularly asked for a shortcode and widget option to output portfolio items:

https://wordpress.org/support/topic/shortcode-for-widget-1/

Edited on 2018-02-12 to note additional requests:

https://wordpress.org/support/topic/genesis-protfolio-pro-wheres-the-shortcode/

nickcernis commented 6 years ago

Initial version done. I'll fix some additional coding standards and await theme test results before sending a PR.

44141951-eee507ac-a07e-11e8-817a-3988ea439fdc
nickcernis commented 6 years ago

phpcs now passing for all files:

View logs ```shell Registering sniffs in the WordPress standard... DONE (144 sniffs registered) Creating file list... DONE (18 files in queue) Changing into directory /Users/nick/Documents/sites/dev/wp-content/plugins/genesis-portfolio-pro Processing plugin.php [PHP => 1477 tokens in 248 lines]... DONE in 61ms (0 errors, 0 warnings) Changing into directory /Users/nick/Documents/sites/dev/wp-content/plugins/genesis-portfolio-pro/lib Processing functions.php [PHP => 631 tokens in 122 lines]... DONE in 40ms (0 errors, 0 warnings) Changing into directory /Users/nick/Documents/sites/dev/wp-content/plugins/genesis-portfolio-pro/lib/classes Processing class-genesis-portfolio-widget.php [PHP => 753 tokens in 129 lines]... DONE in 45ms (0 errors, 0 warnings) Processing class-genesis-portfolio-archive-settings.php [PHP => 432 tokens in 77 lines]... DONE in 36ms (0 errors, 0 warnings) Changing into directory /Users/nick/Documents/sites/dev/wp-content/plugins/genesis-portfolio-pro/lib Processing admin-style.css [CSS => 33 tokens in 5 lines]... DONE in 1ms (0 errors, 0 warnings) Processing template-loader.php [PHP => 526 tokens in 78 lines]... DONE in 39ms (0 errors, 0 warnings) Processing default.css [CSS => 723 tokens in 114 lines]... DONE in 5ms (0 errors, 0 warnings) Processing post-types-and-taxonomies.php [PHP => 868 tokens in 90 lines]... DONE in 58ms (0 errors, 0 warnings) Changing into directory /Users/nick/Documents/sites/dev/wp-content/plugins/genesis-portfolio-pro/lib/templates Processing single-portfolio.php [PHP => 210 tokens in 34 lines]... DONE in 33ms (0 errors, 0 warnings) Processing taxonomy-portfolio-type.php [PHP => 252 tokens in 39 lines]... DONE in 34ms (0 errors, 0 warnings) Processing archive-portfolio.php [PHP => 218 tokens in 37 lines]... DONE in 33ms (0 errors, 0 warnings) Changing into directory /Users/nick/Documents/sites/dev/wp-content/plugins/genesis-portfolio-pro/lib/views/widget Processing portfolio.php [PHP => 1387 tokens in 197 lines]... DONE in 61ms (0 errors, 0 warnings) Changing into directory /Users/nick/Documents/sites/dev/wp-content/plugins/genesis-portfolio-pro/lib/views/admin/archive-settings Processing posts-per-page-meta.php [PHP => 125 tokens in 24 lines]... DONE in 35ms (0 errors, 0 warnings) Changing into directory /Users/nick/Documents/sites/dev/wp-content/plugins/genesis-portfolio-pro/lib/views/admin/widget-form Processing portfolio-title.php [PHP => 556 tokens in 40 lines]... DONE in 45ms (0 errors, 0 warnings) Processing widget-title.php [PHP => 147 tokens in 21 lines]... DONE in 35ms (0 errors, 0 warnings) Processing view-all.php [PHP => 378 tokens in 28 lines]... DONE in 38ms (0 errors, 0 warnings) Processing general.php [PHP => 776 tokens in 62 lines]... DONE in 48ms (0 errors, 0 warnings) Processing featured-images.php [PHP => 579 tokens in 46 lines]... DONE in 45ms (0 errors, 0 warnings) ```

Now awaiting plugin testing before PR and merge.

dreamwhisper commented 6 years ago

@nickcernis I'm starting to test so I'll leave a checklist here for any issues and edit.

nickcernis commented 6 years ago

Thanks, @dreamwhisper. I've reverted to entry-header over portfolio-header, so it will now be: <header class="entry-header">. (context can't take an array of two values, and the class comes from the context). If you need portfolio-header too, though, let me know.

Please feel free to add to the above should you find anything more.

dreamwhisper commented 6 years ago

Ah, yeah, a filter would work, but it really isn't necessary with the widget classes. problem solved :) will continue testing.

KerriMarvel commented 6 years ago

I'm using the Genesis Portfolio Pro plugin, vers. 1.1. on my portfolio page. But where can I find the actual widget like nickcernis displays above? I can't find it!

nickcernis commented 6 years ago

@KerriMarvel The widget is in development and will be released as part of Portfolio Pro 1.2.

nickcernis commented 6 years ago

For testing:

Test in feature/portfolio-widget branch.

Setup

Add a portfolio widget to any widget area.

Confirm

Ali-RMD commented 6 years ago

@nickcernis Confirmed +1

Environment:

WordPress: Version: 4.9.8

PHP: Versions: 5.6.24 & 7.1.14

Genesis Framework: Version: 2.6.1

Active Themes: Genesis Sample - Version: 2.6.0 Essence Pro - Version: 1.0.2

Branch: https://github.com/studiopress/genesis-portfolio-pro/tree/feature/portfolio-widget

Results:

(couldn't find any error in HTML or structured data)

nickcernis commented 6 years ago

Thanks so much for your help testing these, @Ali-RMD!

danbo321 commented 5 years ago

Here is some honest negative feedback to the development of this plugin. Consider that many developers, who build their sites on the Genesis framework, are not interested in hacking a plugin to get it to work with their projects the way they need it to, especially one that functions as a custom post type. For instance, attempting to create an archive-portfolio template, to allow more granular functionality, is rendered moot by this plugin and throws all conventional Genesis hooks out the window. The whole point of developing with Genesis is control and customization and understanding the code behind it. If people want an idiot proof portfolio based theme they might as well head over to Themeforest and buy one there. Building a plugin with only partial features doesn't reflect what Genesis developers expect from StudioPress, all we have to do is remember Simple Hooks and Simple Edits to understand what a Genesis plugin is supposed to be. Unfortunately, IMHO, Genesis Portfolio Pro is neither useful as a portfolio option and definitely is not worth using as a pro.

nickcernis commented 5 years ago

Thanks for your feedback, @danbo321.

…attempting to create an archive-portfolio template, to allow more granular functionality, is rendered moot by this plugin and throws all conventional Genesis hooks out the window.

You can create an archive-portfolio.php template in your child theme and still use regular Genesis hooks. We do this in the Minimum Pro StudioPress theme for the layout on the portfolio page.

If there's a customisation you need help with for the portfolio archive, the best place to seek advice is from the resources listed here: https://studiopress.github.io/genesis/contribute/community/

Building a plugin with only partial features doesn't reflect what Genesis developers expect from StudioPress…

You're welcome to open feature requests as new GitHub issues if there is essential functionality missing that prevents you from using the plugin. It's also fine to use other plugins/themes that better meet a particular site's needs. There are over 10,000 active installations of this plugin on sites that do find it useful, but it may not be the perfect fit for every project.