- This topic has 24 replies, 3 voices, and was last updated 5 months, 2 weeks ago by
Ying.
-
AuthorPosts
-
September 27, 2022 at 5:41 am #2355165
Jatin
Hi Guys,
I want to update all Internal Links on my site similar to what has been done on the other site I saw on internet.
Also, I want to highlight a word or couple of words within a paragraph same way as done in the other site. [Please refer to the screenshot]
I know this is possible using CSS. Could you please check the sizes and screenshots and provide the code.
I have entered the Site and Screenshot Information in the Private box due to security reasons.
September 27, 2022 at 7:17 pm #2355860Fernando Customer Support
Hi Jatin,
You can try adding this CSS:
.entry-content a{ transition: background-color .3s ease-in; border-radius: 4px; } .entry-content a:hover { background-color: #00ff00; }
As for the highlight, there should be a WordPress feature for that in the toolbar. Example: https://share.getcloudapp.com/p9uQkZBL
September 27, 2022 at 11:58 pm #2356004Jatin
Do you know how the post meta is adding on this site which includes comments as well on the right side ?
September 28, 2022 at 12:30 am #2356033Fernando Customer Support
Which are you referring to? Can you share a screenshot?
September 28, 2022 at 1:18 am #2356083Jatin
I have shared the link of the site in Private box where the post meta is added on Archive Page and Single Page.
Need similar on my site as well.How it has been added / Stylized with Comments showing in meta.
September 28, 2022 at 9:30 am #2356632Jatin
Thanks for Internal Link Code shared earlier.I have now applied it. However, when i click on the Link and return back on the page. I see border and underline both under the link. Is there any way to disable Underline on the link?
Screenshot and URL given in the box.
September 28, 2022 at 11:38 am #2356731Ying
StaffCustomer SupportDo you know how the post meta is adding on this site which includes comments as well on the right side ?
It’s using custom function to add the comment.
But you can use a block element – post meta template to achieve this easily without writing codes.
I see border and underline both under the link
Try this CSS:
.entry-content a:focus { text-decoration: none; }
September 28, 2022 at 11:04 pm #2357217Jatin
Thank you.
I do not want to use generateblocks and want to keep it simple.
Is there any way I can create a similar post meta without using GenerateBlocks.
Can you please fetch the code of the custom function ?
September 28, 2022 at 11:43 pm #2357242Fernando Customer Support
Add these PHP snippets first:
add_filter( 'generate_header_entry_meta_items', function() { return array( 'date', 'author', 'comments-link', ); } ); add_action( 'wp', function() { if ( is_single() ) { add_filter( 'generate_show_comments', '__return_true' ); } } ); add_filter( 'generate_footer_entry_meta_items', function( $items ) { return array_diff( $items, array( 'comments-link' ) ); } );
Adding PHP: https://docs.generatepress.com/article/adding-php/#code-snippets
We’ll go from there.
September 29, 2022 at 4:40 am #2357507Jatin
Thank you. I want some help on the Internal Link.
Ying provided to switch of text decoration for links which worked fine. However, some of the links are still showing double lines.
Example link and screenshot in the box please.September 29, 2022 at 10:58 am #2358018Ying
StaffCustomer SupportThis underline style is added inline, so it’s likely added within the block settings, and it’s added to the
span
not thea
.So the CSS I provided will not work.
Try adding this CSS as well to override the block setting:
.entry-content a >* { text-decoration: none !important; }
October 1, 2022 at 11:07 pm #2360246Jatin
Hi Fernando, the PHP code you shared is it just for comments or its for date author and comments?
I want to keep the code to minimum and just require comments.
I have added this code, whats next ?
October 2, 2022 at 5:11 pm #2360926Fernando Customer Support
That code’s purpose is to make the comments count appear beside the date and author meta in the entry-meta section.
Now, add this code in Appearance > Customize > Additional CSS to push the comments count to the right:
header.entry-header .entry-meta { display: flex; } header.entry-header .entry-meta span.comments-link { margin-left: auto; }
October 2, 2022 at 11:57 pm #2361122Jatin
Thanks Fernando.
Its showin the comments on the right hand side on the my laptop. However I still below issues / queries:
1. when you check the post meta on a mobile phone. Its overlapping and not displaying nicely.
2. Is there any way to not show on exterme right hand side and show it something like this with a Line after authorname.
3. I am using WPCode to add the code, Do you suggest / recommend Code Snippets or WPCode ?
4. Do you want me to run the PHP Code provided “Run Everywhere” or specific places. I want to avoid any slowness on my side due to more code.Last updated on:<date> by <authorname> | 30 comments
October 3, 2022 at 1:01 am #2361157Fernando Customer Support
1-2. Would you like it to look like this for all views? Just a line separator? Can you remove the code I provided here: https://generatepress.com/forums/topic/internal-links-and-higlighting-a-word-in-a-paragraph-like-in-screenshot/#post-2360926
3. I personally use Code Snippets. I’m not familiar with WPCode, but if it works, then that should be good.
4. These are hooks, they only run when they appear in a specific loading of a page. The other one has a conditional statement that only runs for single post pages. For the CSS we’ll provide, you can use a plugin like simple CSS if you want it to load only for specific pages. -
AuthorPosts
- You must be logged in to reply to this topic.