-
JorgeV
Hi there,
I wanna use the post format link to create some posts and when clicking on them they go to a different site, where the post is really written.
But the issue is that the link open the post hosted on this site and not the link I added to the post.
Can you help me sort this out?
Thank you!
Cheers -
Hi there,
i don’t think the Latest Post block is that smart, and it has no filter functions for that to change.
Use a GB Query Loop block instead. And then let me know.
-
JorgeV
Hi David,
Thanks for the quick reply.
I did what you mentioned, but the results stays the same.
The link is not going to the one that should be (you can see it, the destination link I want it, on the excerpt section of the post)Thanks
Cheers -
yeah having a brain freeze today.
Use the Query Loop and see my reply here:https://generatepress.com/forums/topic/post-title-with-external-link/#post-2433624
-
JorgeV
Hi David,
That worked 😉
There is not a more general solution, like apply to all post link format posts, instead of post by post basis?
And other question, how can I make it to open in a new window the post format link posts.
Thank you for the help
Cheers
Jorge -
You wouldn’t need to add it to every post, just the single Headline block in the Query Loops post template ? What am i missing ?
-
JorgeV
Hi David,
Now has me having a brain freeze.
Thanks for all. Everything is working using your instructions.
Cheers
-
Do you still need the external link open in a new tab ?
-
JorgeV
Yes please. Was forgetting that.
Thank you
-
Try adding this snippet too:
add_filter( 'render_block', function( $block_content, $block ) { if ( ! empty( $attributes['className'] ) && 'dynamic-title' === $attributes['className'] ) { $block_content = str_replace( '<a ', '<a target="_blank" rel="nofollow" ', $block_content ); } return $block_content; }, 10, 2 );
-
JorgeV
Hi David,
Added the code, but the string is not being replaced 🙁
-
hmmm… try the one here:
https://generatepress.com/forums/topic/post-title-with-external-link/#post-2438846
-
JorgeV
That one is working 🙂
Thank you very much, again 🙂
-
Glad to hear that!
- You must be logged in to reply to this topic.