Target="_blank" not working - wordpress

Im develope website with wordpress, Im use plugin Magge Short code
I want to create a "link" with shortcode Magee. Here is my current code
[ms_social icon_size="25px" title="Instagrame" target="_blank" icon="fa-instagram" iconcolor="" effect_3d="yes" backgroundcolor="" iconboxedradius="normal" iconlink="https://www.instagram.com/" class="" id=""][/ms_social]
Everything works except _blank attribute, even putting "_blank". Can anyone help me fix my code to the link opens in a new tab?
Thanks!

Try this one
plugin :magee-shortcodes/shortcodes/class-social.php
line number: 71 or find this below code and add
target="_blank"
$html=sprintf(' %s ',
$styles,$iconlink,$id,$icon,$sty3d,$class,$uqid,$title);

Related

How to open wordpress post in new tab

I'm using Hoot Business Theme, i can't find where I can insert target_blank" there is no loop.php in this theme. Is there any other way to open wordpress post in new tab?
The simplest way to achieve this without messing about in your template files is with jQuery:
$('a.addSomethingBlogSpecificHere').attr('target','_blank');
You need to add target="_blank" in anchor tag HTML like :
<a href="#" target="_blank" > Label Name </a>

Clicking a link displays address in URL but doesn't open the page

I am creating a theme on wordpress with Bootstrap CDN. I created a button as:
<div class="col-md-4"><a href="<?php echo get_permalink(); ?>"
class="btn btn-lg btn-block">Read Latest</a></div>
It displays link as button and when I click it, url bar displays the link that should be opened, but page doesn't open.
I know this is a very noob question but I'm stuck, any help is appreciated.
Thanks!
Update:
The Resulting html link to the php I used is: http://localhost/baatega/bad-day-eh/
First, I don't quite understand the issue - the link is not correct? or what? Could you paste here please print screen or reproduce the issue in jsFiddle? It's more or less question for the WordPress development forum here, however if it's the case of link:
Check if get_permalink(); is used within the Loop. (if not, you have to pass the ID as an argument to it)
try to echo the escaped url: esc_url( get_permalink() );
Have a look here: https://developer.wordpress.org/reference/functions/get_permalink/

Wordpress automatically adding site url to href, though href not empty

So I'm trying to debug a somewhat confusing problem. I'm using a Wordpress plugin for a Topspin store that uses colorbox to popup a window to display more information about an item. Here's the site: okgo.net/store. In the backend code for this page a div block is created containing links that that should look like this:
<a class="topspin-view-item" href="#!/77022">
The php that does that is as follows:
<a class="topspin-view-item" href="#!/<?php echo $item['id']; ?>">
The problem is that what is being spat out at the end is not that. It looks like this:
<a class="topspin-view-item" href="http://okgo.net/video-store/#!/89712">
I've understood from another post on here that the default behavior of Wordpress is to fill empty hrefs (ie href="") with the site url. So my guess is that Wordpress is for some reason interpreting this as an empty href? Except that that doesn't seem quite right either.
I've played around with this a bit. One thing that happens is that if I remove the has from the above PHP the siteurl is not output at all. That of course breaks my code.
Any ideas? Any help would be warmly appreciated.
The way we ended up fixing this for those who may be interested is by simply adding the following line of code to the jQuery handler that dealt with the on submit event:
event.preventDefault()
Perhaps this will be of help to someone...

Twitter share button doesn't forward custom text

I'm working on a website with twitter share option for each specific product.
I followed twitter API instructions for tweet-sharing, and everything works fine except custom display of text. For example I want user to tweet like this:
"What do you think? Should I buy this? http://url.etc #mywebsite"
but all I get when user tweets is the link:
http://url.etc
This is the code:
<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
<a target="_blank" href="https://twitter.com/share" data-url="http://bit.ly/twitter-api-announce" data-via="testtest" data-text="What do you think? Should I buy this? " data-count="none" data-counturl="http://groups.google.com/group/twitter-api-announce" >TWITTER</a>
The problems seems to be with data-text option.
Any experience on this? Ideas?
Thanks
On Wordpress I just used Tweet
Works like a charm!
simply use a link like :
tweet
Just change what is between [] (and remove them)
note that everything have to be RFC (with weird chars such as 'space' replaced by %20 etc.)
twitter propose a nice page to make the buttons
https://about.twitter.com/resources/buttons#tweet
But my solution avoid the javascript to force the design of the buton
You can use this:
<a href='https://twitter.com/share?url=google.com&text=Signup>Tweet</a <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src='//platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document,'script','twitter-wjs');</script>
Confirm that you have included the correct twitter scripts . Better still, generate your tweet button code from the twitter developer interface here ..
https://about.twitter.com/resources/buttons
If you would like to modify the tweetbutton content on the fly ...e.g after page load, you will have to creat and insert your tweet button into the html DOM dynamically .
Some guidance on that can be found here .
http://denvycom.com/blog/twitter-button-with-dynamic-custom-data-text-message/
Hopefully this is helpful.
You have to encode your text before inserting it in the link. The correct procedure is:
Encode the text with an online tool like this one
Put the result inside an HTML link (as suggested by #FenixAoras): Share on Twitter
If you generate your HTML with php, you can use the urlencode function directly in your script:
echo "Share on Twitter";
If you are using WordPress, the best way is creating a shortcode, beacuse with it you can use also the native functions of WordPress:
function tweet_this($atts, $content = null)
{
extract(shortcode_atts(array(
"text" => ''
), $atts));
return "<a href='https://twitter.com/intent/tweet?text=".urlencode( $text." - ".get_the_title()." - ".get_permalink() )."'>Share on Twitter</a>";
}
add_shortcode( 'tweet_this', 'tweet_this' );
(Note: the code above is just a lead, you can expand it and you have to test)
Usage:
[tweet_this text="my custom text with #hashtag and #Mention"]

Wordpress: get link title

I want to use the jGrowl plugin with my custom wordpress theme.
my case: you click on a link and a growl-like message box opens. My message should be the link's title text.
But how can I echo/display this title? where can I get it from? I already did some research but couldn't find any solution.
(I really don't mean "the_title()" .. more like this one <a href="" title="">
just google it: "php get title from url".
You'll find some php classes.
You can use them to get Title of page from given url and use it in jGrowl.
Cheers!

Resources