osompress / genesis-portfolio-pro

Plugin: Genesis Portfolio Pro
24 stars 14 forks source link

Add posts per page setting for portfolio Archives #6

Closed dreamwhisper closed 7 years ago

dreamwhisper commented 10 years ago

Include a posts per page setting for Portfolio archives so it can be set independently from the standard setting.

dreamwhisper commented 7 years ago

Spec:

carasmo commented 7 years ago

+1

dreamwhisper commented 7 years ago

@NicktheGeek I'm not sure how to handle this, but if someone has the plugin, it would be great not to change their current posts per page on update. So, maybe the default needs to just be what is currently set as posts per page.

Then, the filter can be used to update it on new theme activation.

NicktheGeek commented 7 years ago

@dreamwhisper it will probably bear some testing, but I've coded this so that the setting defaults to the option in the reading settings. It will require intentionally changing it to alter the value, so it won't affect it until the setting is changed.

NicktheGeek commented 7 years ago

@dreamwhisper I've published the release candidate branch. release/1.1 if you want to give it a test. It just includes the 3 issues here https://github.com/copyblogger/genesis-portfolio-pro/milestone/1

dreamwhisper commented 7 years ago

Genesis Portfolio Pro

nickcernis commented 7 years ago

@NicktheGeek I think this:

if ( ! $query->is_archive( 'portfolio' ) && ! $query->is_tax( 'portfolio-type' ) ) {
    return;
}

Needs to be this:

if ( ! $query->is_post_type_archive( 'portfolio' ) && ! $query->is_tax( 'portfolio-type' ) ) {
    return;
}

Here: https://github.com/copyblogger/genesis-portfolio-pro/commit/50d570617a68e218e70202611b4114b9e2d6c084#diff-55d3bf5e833c76ee6e3c2f4be15fa1cdR234

At the moment the new setting works but it is affecting regular post category archives too:

archive_settings_ _wp_test_ _wordpress portfolio_items portfolio_types_flowers reading_settings_ _wp_test_ _wordpress category__1
NicktheGeek commented 7 years ago

updated

nickcernis commented 7 years ago

Confirmed:

category__1_and_portfolio_items_and_portfolio_types_flowers