social icons meta description author box
-
Hi lovely WP-People,
I have a tiny problem and can’t fix it. I am using a theme that gives the ability to have an author description after every post and includes the possibility to add an author link and twitter profile. Unfortunately no other social icons. I managed to add the Icons but can’t get the css for the formatting right. As soon as I add some code to adjust the genericons, i included they disappear. may be you have an idea?
Here is the full ?history“ of code I added:
1.
I did not had to add
user_contact_methods
because i use the Yoast SEO Plugin, that adds them already.2. adding code to author box
<?php if(get_the_author_meta('user_url') ): ?> <?php $author_url = get_the_author_meta('user_url'); $to_remove = array( 'https://', 'https://' ); foreach ( $to_remove as $item ) { $author_url = str_replace($item, '', $author_url); } echo '<a class="author-website" href=' . get_the_author_meta('user_url') .'> ' . $author_url . ' </a>'; ?> <?php endif; ?> <?php if(get_the_author_meta('twitter') ): ?> <a class="author-twitter" target="_blank" rel="noopener noreferrer" href="https://www.twitter.com/<?php echo get_the_author_meta('twitter'); ?>"><?php echo get_the_author_meta('twitter'); ?></a> <?php endif; ?> <?php if(get_the_author_meta('facebook') ): ?> <a class="author-facebook" target="_blank" rel="noopener noreferrer" href="https://www.facebook.com/<?php echo get_the_author_meta('facebook'); ?>"><?php echo get_the_author_meta('facebook'); ?></a> <?php endif; ?> <?php if(get_the_author_meta('instagram') ): ?> <a class="author-instagram" target="_blank" rel="noopener noreferrer" href="https://www.instagram.com/<?php echo get_the_author_meta('instagram'); ?>"><?php echo get_the_author_meta('instagram'); ?></a> <?php endif; ?>
3. I have included the following css for the genericons (they are uploaded already in theme as font)
.author-links a.author-facebook:before { font: normal 18px/1 'Genericons'; content: 'f203'; } .author-links a.author-instagram:before { font: normal 18px/1 'Genericons'; content: 'f215'; }
4.
and to adjust the distance between the social accounts i used the following css code.author-links a.author-facebook, .author-links a.author-twitter { margin: 4px 30px 0 0; }
5.
and to adjust the hieght of the genericons.author-links a.author-website:before, .author-links a.author-twitter:before, .author-links a.author-facebook:before, .author-links a.author-instagram:before { display: block; position: absolute; top: 2px; left: -4px; text-align: left; }
as soon as I put in the css code to adjust the genericons they dissapear – and I can’t find why?
Anyone an idea?
Thank you for any help in advance,
JoThe page I need help with: [log in to see the link]
- The topic ‘social icons meta description author box’ is closed to new replies.