Social Icons

twitterfacebookgoogle pluslinkedinemail
Showing posts with label Wordpress. Show all posts
Showing posts with label Wordpress. Show all posts

Sunday, 6 August 2017

Share Facebook and twitter in magento

Hello Friends,

This article is use to share your product in facebook and twitter. Here is the simple code to add into app/design/frontend/<theme>/<theme>/template/catalog/product/view.phtml

Please check first your theme path and also detail page file. here is the default path
 app/design/frontend/base/default/template/catalog/product/view.phtml

You can find file path to enable path hint from back-end.

Add below code and save the file

<?php $_productName = urlencode(trim($_helper->productAttribute($_product, $_product->getName(), 'name')))?>
                    <?php $_productImageUrl = urlencode(trim($this->helper('catalog/image')->init($_product, 'image')))?>
                    <?php $_productUrl = urlencode(trim($_product->getProductUrl()))?>
<?php $_u = 'p[url]=' . $_productUrl . '&p[images][0]=' . $_productImageUrl . '&p[title]=' . $_productName . '&p[summary]=' . urlencode(trim($_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description'))); ?>   
                    <div class="social-links" style="float: right;">
                        <a href="javascript:void(0);" title="<?php echo $this->__('Share on Facebook') ?>" class="link-facebook svg-replace" onclick="window.open( '<?php echo 'http://www.facebook.com/sharer.php?s=100&' . $_u; ?>' , '_blank' ,'height=500,width=500'); return false">
                            <img class="fb-icon" style="" src="<?php echo $this->getSkinUrl(); ?>images/social-fb-icon.png" alt="Share Facebook" />
                        </a>
                       
                        <a href="javascript:void(0);" target="_blank" title="<?php echo $this->__('Share on Twitter') ?>" class="link-twitter svg-replace" onclick="window.open( '<?php echo 'http://twitter.com/home?status=' . $_productName . '+' . $_productUrl; ?>' , '_blank' ,'height=500,width=500'); return false">
                            <img class="twitter-icon" style="" src="<?php echo $this->getSkinUrl(); ?>images/social-twitter-icon.png" />
                        </a>
                    </div>

Notes: This code will help you in core php, WordPress, Drupal, Joomla and other framework also you just need to setup parameter and it will work.

Thank you,
Enjoy Your Self,

Saturday, 26 October 2013

Favicon icon not display in IE OR Firefox or Chrome

Hello Friends,



When you want to try add Favicon icon and then its not display in IE please use following step to display favicon icon in IE.

1. Please following code

<head>
<link href="http://anantprajapati.blogspot.in/favicon.ico" rel="icon" type="image/x-icon"></link>
<link href="http://anantprajapati.blogspot.in/favicon.ico" rel="shortcut icon" type="image/x-icon"></link>
<link href="http://anantprajapati.blogspot.in/favicon.ico" rel="icon" type="image/vnd.microsoft.icon"></link>
</head>


Tuesday, 13 August 2013

Protecting Your Wordpress Site From Hackers

Make your wordpress site so it cant be hacked...

1) Go to the plugin section and search Login Lockdown and install this plugin.

What this plugin does....

Makes sure u can only login with your ip and it also has a password feature were you
only get so many times of login attempts but the downside of this is you will need
to update the htaccess folder whenever u move to another area.

Features:

Prevents bruteforce attacks.
Ip login feature.

2. You see that update button...Click that and update button in dashboard and update
to the latest version because there is vulnerabilities in the older versions
were u can be hacked.... and also of course keep your plugins up to date because
older versions may cause security risks to your wordpress site.

Thursday, 11 April 2013

How to get all post data from wordpress using custom query

get all post using custom or select query using following code
<?php
 $querystr = "
    SELECT $wpdb->posts.*
    FROM $wpdb->posts, $wpdb->postmeta
    WHERE $wpdb->posts.ID = $wpdb->postmeta.post_id
    AND $wpdb->postmeta.meta_key = 'tag'
    AND $wpdb->postmeta.meta_value = 'email'
    AND $wpdb->posts.post_status = 'publish'
    AND $wpdb->posts.post_type = 'post'
    AND $wpdb->posts.post_date < NOW()
    ORDER BY $wpdb->posts.post_date DESC
 ";

 

Free Advertisement

Free Advertisement

Free Advertisement

Free Advertisement