Site logo

Archived topic

Text Before Post Listing At Homepage

9 replies · Started by max on November 4, 2020

Viewing posts 1–10 of 10

Hi. How to put text at content area before post listing at homepage?
Please guide me

please check screenshot

done
tq

No problem. Glad to be of any help. :)

sorry
we had problem
we want to appear the front page only
no at page 2, page 3 etc

In that case you would need this PHP snippet:

add_filter( 'generate_hook_element_display', function( $display, $element_id ) {
    if ( 123 === $element_id && is_paged() ) {
        $display = false;
    }

    return $display;
}, 10, 2 );

Adding PHP: https://docs.generatepress.com/article/adding-php/

Replace 123 with the actual element ID.

We will be adding this in the display rules in the next version of GP Premium :)

sorry i didn' understand
need to install plugin?

sorry i didn’ understand
need to install plugin?

To add Leo's PHP snippet, you either use a child theme and add the snippet on its functions.php

Or

If you don't want to use a Child theme, you can install the Code Snippets plugin to be able to run the PHP snippet.

Adding PHP:https://docs.generatepress.com/article/adding-php/

1) where to get child theme?
2) and we need to activate full theme & child theme? and set primary for child theme?

This archived topic is closed to new replies.