Site logo

Archived topic

Social icons in the blog footer using generate_after_content

9 replies · Started by Carrie on September 24, 2019

Viewing posts 1–10 of 10

Good afternoon! I'm trying to insert Font Awesome icons at the bottom of each blog post using the generate_after_content hook, and I don't really understand how to do this. After reading the help documentation, I came up with the below code, but publishing it generates an error message - "Parse error: syntax error, unexpected '}', expecting end of file in /home/carriemo/public_html/wp-content/plugins/gp-premium/elements/class-hooks.php(180) : eval()'d code on line 7."

Would you mind telling me how to correct it?

add_action( 'generate_after_content','social_icons' );
function example_function_name() { ?> <i class="fa-icon-linkedin"></i> <i class="fa-icon-instagram"></i> <i class="fa-icon-facebook"></i> <i class="fa-icon-twitter"></i>
<?php }

Font Awesome caused my mobile page speed to crash. I've been using it in the header without the plugins and don't have any issues.

GP itself doesn't load FA by default. So if you are able to use it somewhere else, likely another plugin (page builders) is loading it for you.

If you are using hooks element, then you don't need the add_action part, simply add the HTML part like this:
<i class="fa-icon-linkedin"></i><i class="fa-icon-facebook"></i><i class="fa-icon-instagram"></i>

Although blank is probably better than an error code! LOL

Never mind, I got it! The word "icon" has to be removed. It no longer uses it.
It's "fa fa-facebook" as an example, not "fa fa-icon-facebook."
Thank you so much for your help... I appreciate it.

Glad you’ve figured out :)

This archived topic is closed to new replies.