- This topic has 9 replies, 3 voices, and was last updated 4 years, 11 months ago by
Elvin.
-
AuthorPosts
-
November 4, 2020 at 10:10 pm #1518509
max
Hi. How to put text at content area before post listing at homepage?
Please guide meplease check screenshot
November 4, 2020 at 10:54 pm #1518530Elvin
StaffCustomer SupportHi,
You can check our Hooks Visual Guide documentation for hooks you can use to place your text:
https://docs.generatepress.com/article/hooks-visual-guide/We then add the desired text using a Hook Element found on Dashboard > Appearance > Elements.
https://docs.generatepress.com/article/hooks-element-overview/November 4, 2020 at 11:42 pm #1518550max
done
tqNovember 5, 2020 at 12:28 pm #1519658Elvin
StaffCustomer SupportNo problem. Glad to be of any help. 🙂
November 19, 2020 at 9:26 pm #1538459max
sorry
we had problem
we want to appear the front page only
no at page 2, page 3 etcNovember 19, 2020 at 9:36 pm #1538468Leo
StaffCustomer SupportIn 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
123with the actual element ID.We will be adding this in the display rules in the next version of GP Premium 🙂
November 22, 2020 at 5:30 pm #1541619max
sorry i didn’ understand
need to install plugin?November 22, 2020 at 5:33 pm #1541621Elvin
StaffCustomer Supportsorry 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/
November 22, 2020 at 5:38 pm #1541625max
1) where to get child theme?
2) and we need to activate full theme & child theme? and set primary for child theme?November 22, 2020 at 5:51 pm #1541631Elvin
StaffCustomer SupportHere’s brief documentation about using child theme/s.
https://docs.generatepress.com/article/using-child-theme/Note: Using a code snippet plugin maybe more practical if you have no idea how child themes work.
Code Snippets plugin is pretty lightweight so you don’t have to worry about it adding bloat.
https://wordpress.org/plugins/code-snippets/ -
AuthorPosts
- You must be logged in to reply to this topic.