Link "see all news" button to open in new tab


#1

How do I allow the button that says “see all news” in Latest news widget to open in a new tab? It currently refreshes on the same page.

My web is www.ulinkchina.com and the button currently says "查看更多信息”。 It basically opens up to the blogpost page which has all the posts.

Thanks,
Linda


#2

Hi,

Please add a target="_blank" to the anchor tag in widgets / fp-latest-news.php, line 125:

<a href="<?php echo esc_url(get_category_link(get_cat_ID($cat -> name))); ?>" class="roll-button more-button"><?php echo $see_all_text; ?></a>

So the code should look like this ( after the target="_blank" is added ):

<a href="<?php echo esc_url(get_category_link(get_cat_ID($cat -> name))); ?>" class="roll-button more-button" target="_blank"><?php echo $see_all_text; ?></a>

Please let me know how it works.

Best Regards,
Csaba


#3

Hey Csaba,

It still refreshes on the same page , doesnt open to a new tab.

Is there something else I can try?

Thanks,
Linda


#4

I added target="_blank" to the next line as seen below and it works great now!

" class=“roll-button more-button” target="_blank"><?php echo $see_all_text; ?>

thanks!


#5

Hi,

Ok, Great! I’m glad it’s resolved! If you need help with anything else, please open a new topic.

Have a nice day!

Best Regards,
Csaba