Hi, though this is a very basic level question to open a link in a new tab (I know about target="_blank" protocols), I couldn't do it with Post excerpt link as the mentioned protocols cannot be added. Now let me know how to do this in the following code.
I would add the link manually immediately after the post excerpt, adding the attribute format="noautop" to the wpv-post-excerpt shortcode so that it is not wrapped in p tags so that the link you create appears on the same line, e.g.
The format="noautop" simply stops the excerpt being output within p tags, so that the link you add immediately after the excerpt isn't forced onto the next line.
I tested the above on my own site and it does exactly what's expected.
It displays an excerpt from the parent post, a "read more" link, which opens the parent post in a new tab.
That hasn't added anything to the page, can I take a look at your site to see why?
Let me mark your next reply as private so that I can get log-in credentials from you—you may want to create a temporary admin user for me to use that you can later delete. And be sure to have a current backup of your site.
All I did was edit your template, comment out your existing section where you inserted the post excerpt and added what I had suggested above, and it works as expected, the read more link opens in a new tab.
Hi Nigel,
Thanks for your support. You have almost met my requirements except the line break. The button is appearing below the line. I want the button on the same line as it was earlier (I have marked with an arrow). Hope you understood my point. Thanks
The problem is that you have another plugin automatically inserting content at the end of the excerpt which forces a new line (see the screenshot, the div added by the AddThis plugin).
Is it possible to change the AddThis settings so that it doesn't add anything to the excerpts on these pages?
Otherwise you would need to add some CSS that changes the display property of that empty div to inline so that it doesn't break the flow.