generate_logo

generate_logo

The generate_logo filter allows you to change your logo.

Default (URL): Your logo set in Customize > Site Identity.

Usage

Please refer to the Using Filters article to learn how to use this filter.

Examples

If you want to show a different logo inside categories, you could do this:

add_filter( 'generate_logo', function( $logo ) {
// Return our category logo URL
if ( is_category() ) {
return 'URL TO YOUR CATEGORY LOGO';
}

// Otherwise, return our default logo
return $logo;
} );

If you want to show a different logo for different languages, you could do this:

add_filter( 'generate_logo', function( $logo ) {
if ( ICL_LANGUAGE_CODE == 'en' ) {
return 'URL TO ENGLISH LOGO';
}

return $logo;
} );

generate_term_separator

generate_term_separator

The generate_term_separator filter allows change the default comma between each meta terms.

For example, we can use this snippet to change the separator to dash:

add_filter( 'generate_term_separator', function() {
return '-';
} );

Resolving Topics

Resolving Topics

In our support forum, we currently only allow one unresolved topic per user at a time to keep the queue moving for everyone.

If you have an unresolved topic, you won』t be able to start a new topic. Instead, you』ll see a message like this:

Click the 「here」 link to the unresolved topic to open it. If it』s resolved, click the option shown below and set it to 「Resolved」.

Now you』ll be able to open a new topic.

If it』s not resolved yet, please work with us to get it resolved before opening a new topic.

If you urgently need help and have an unresolved topic, feel free to contact us directly through our contact page.

Adding Image Sizes

Adding Image Sizes

As of GP Premium 1.10.0, we removed on-the-fly image sizing for featured images in our Blog module. WordPress itself has a hard time with this, and all of the available solutions have pretty significant downfalls.

By default, WordPress has a handful of image sizes to choose from:

full – the full sized imagelargemediumthumbnail

You can find these image sizes in Settings > Media.

It』s possible to create new image sizes specific to your site with a simple function. For example:

add_action( 'init', function() {
add_image_size( 'my-archive-featured-image', 500, 200, true ); // 500 width, 200 height, crop
} );

Learn more about the available parameters here.

You can add more than one size at once:

add_action( 'init', function() {
add_image_size( 'my-archive-featured-image', 500, 200, true ); // 500 width, 200 height, crop

add_image_size( 'my-single-featured-image', 800, 500 );
} );

Once you』ve added your image sizes, you can choose them from the 「Size」 dropdown in Customize > Layout > Blog.

The last thing you need to do is regenerate your thumbnails. WordPress doesn』t do this by default, so it』s necessary to use a plugin like this.

generate_inside_post_meta_item_output

generate_inside_post_meta_item_output

The generate_inside_post_meta_item_output filter allows you to add content after the post meta.

For example, we can use this snippet to add the text 「Publish in」 before publishing the category meta:

add_filter( 'generate_inside_post_meta_item_output', function( $output, $item ) {
if ( 'categories' === $item ) {
return ' Published in ';
}
return $output;
}, 50, 2 );

Image Processing Queue Transient Bug

Image Processing Queue Transient Bug

Prior to GP Premium 1.10.0, we used a library called Image Processing Queue to add on-the-fly image resizing for your featured images.

We were pretty happy with it until we started seeing some reports of databases getting lots of entries in the wp_options table related to the background process. When these 「jobs」 are initiated, something called a 「transient」 is added to your database to track the job. When the job is finished, the transient is cleaned up and that』s it. However, it seems like in some rare cases, those transients weren』t being cleaned up.

This isn』t something we』ve been able to reproduce on our end using multiple different servers/environments, which is a good thing, as it means it』s not something most people are affected by. However, it also makes it tricky to fix the problem, and even a few people being affected by this was enough for us to want to completely scrap the library and start over, so that』s what we did in 1.10.0.

Is this something you need to worry about? Definitely not. It』s not a security issue, and if you haven』t noticed any frontend issues, chances are the library is working just fine on your server.

If this issue has affected you, it』s still nothing to worry about. Simply update to GP Premium 1.10.0, then use a plugin like Transients Manager to delete your existing transients.

If you』d prefer a non-plugin method, you can search your database for the transients (inside your database manager):

SELECT * FROM wp_options WHERE option_name LIKE '%wp_image_processing%'

Then delete them:

DELETE FROM wp_options WHERE option_name LIKE '%wp_image_processing%'

Display Category Description on First Page only

Display Category Description on First Page only

The category description is displayed on every page of the category archive by default.

If you』d like to display them on the first page of the archive only, try this PHP snippet below:

add_action( 'wp', function() {
$page = (get_query_var('paged')) ? get_query_var('paged') : 1;
if ( 1 !== $page ) {
remove_action( 'generate_archive_title', 'generate_archive_title' );
add_action( 'generate_archive_title', 'tu_custom_paged_archive_title' );
};
}, 20 );

function tu_custom_paged_archive_title() {
?>

<?php
}

generate_logo_href

generate_logo_href

The generate_logo_href filter allows you to change the URL destination of your logo.

Default (string): Your URL set in Settings > General

Example

add_filter( 'generate_logo_href', function() {
return "https://NEW-URL-HERE";
} );

Usage

Please refer to the Using Filters article to learn how to use this filter.