الجمعة، 29 مارس 2013

Shortcodes for your WordPress – how to insert in the post any php code or function

Shortcodes for your WordPress – how to insert in the post any php code or function 

 

Hello, friends. Today I want to tell you about one chip, which recently applied himself on his blog. Let us create something such as their shortcodes that can be used directly in the posts on the blog.wp-images
With the help of these codes you can display any content, dynamic or static – it does not matter, the main thing that this case can be added to any place in writing the post, and later make changes only in one place and not have to edit a bunch of posts.
Let’s just show you live examples to make it clear what is at stake. Here are a couple links to my modules for DLE: LinkEnso PRO, TagFace and CatFace.
What do these three different pages? Then, of course, that there is a question of the modules and DLE, in all these pages there’s such a wonderful unit with images and links:
Example block output shortcode
This block is nothing like a normal html when you view the source code, and is no different from a simple content inserted in the writing position. All true, except that the output is all that stuff with a special code, which I have come up with and put in the post to a convenient location. And to me something to correct or add to this block, I have to edit only one function in the file functions.php.
I think this is kapets as comfortable and I simply must share this topic with you. I’m not the first, and I thought of this, regular expressions come up before I found out what the Internet :)
Write a function and create a shortcode in WordPress
Decided not to roll the long wool, and immediately set to work. So we go into the editor appearance of his skin and find there the file functions.php. Below I will give an example of my own function to generate what you see in the screenshot above.
/*** List the modules anywhere fast ***/
    function my_modules() {
        return '<div style="margin:10px 180px;"><table cellpadding="0" cellspacing="0" border="0"><tr><th colspan="5" style="padding-bottom:10px;">Команда АлаичЪ\'а трудится непокладая рук и вот что у нас есть для вас:</th>
    </tr><tr>
        <td><img src="http://yasserdz.com/wp-content/uploads/2011/03/sitemap.png" alt="HTML SiteMap" title="HTML SiteMap" width="100" height="100"></td>
        <td><img src="http://yasserdz.com/wp-content/uploads/2011/05/catface.png" alt="CatFace" title="CatFace" width="100" height="100"></td>
        <td><img src="http://yasserdz.com/wp-content/uploads/2011/11/snvote-v.1.1.png" alt="SNVote" title="SNVote" width="100" height="100"></td>
        <td><img src="http://yasserdz.com/wp-content/uploads/2012/03/linkenso.png" alt="LinkEnso" title="LinkEnso" width="100" height="100"></td>
        <td><img src="http://yasserdz.com/wp-content/uploads/2012/06/tagface.png" alt="TagFace" title="TagFace" width="100" height="100"></td>
    </tr><tr>
        <th><a href="http://yasserdz.com/post/1974">SiteMap</a></th>
        <th><a href="http://yasserdz.com/post/2086">CatFace</a></th>
        <th><a href="http://yasserdz.com/post/2435">SNVote Free</a><br /><a href="http://yasserdz.com/post/2836">SNVote PRO</a></th>
        <th><a href="http://yasserdz.com/post/3322">LinkEnso Free</a><br /><a href="http://yasserdz.com/post/3982">LinkEnso PRO</a></th>
        <th><a href="http://yasserdz.com/post-name.html">TagFace</a></th>
    </tr></table></div>';
    }
    add_shortcode('DLEmod', 'my_modules');
Bit analyze what is written. For some, it is quite incomprehensible gibberish :)
my_modules – is the name of the function, I made it up myself, you can use any name here, what your heart desires.
return ‘…’; – proper html-content that we want to bring in a post on the site of the shortcode, ie our block. It is important to know that if somewhere in your content inside will return a single quote, as I have “Alaich \ ‘a’, then they must be escaped with a backslash, in the example it shows.
add_shortcode (‘DLEmod’, ‘my_modules’); – a feature that will create for us a shortcode. This uses the WordPress Shortcode API, contains a set of functions to work with the regular season and not just … well, it’s not important to you. In general, the use of this command will create for us a shortcode named [DLEmod] (with no spaces between the name and the brackets) and will be displayed on its site content are my_modules.
My example is a very simple case, using no dynamics, but you can use any script in php. If you are interested, you can naguglit, I just wanted to tell you about the possibility of a little easier on yourself.
If you want, in the future I will consider the possibility of working directly with regular expressions without using WordPress API.
Use of health, write comments and ask questions. Thank you!

 

rating Datalife engine news for Google to release schema.org

rating Datalife engine news for Google to release schema.org 

 

 

Hello, friends. Today decided to burn another topic to modify our beloved engine DLE – we do mikrorazmetku Top News for the extended snippet Google Rich Snippets. As you remember, last time we did mikrorazmetku bread crumbs, if you have not read it, do it now.images-rating-google
In contrast to the previous post, where the chance to trigger our completions was 100%, but this time we will work with the probability of completion “luck – bad luck.” Got Game we, have abused this mikrorazmetkoy and Google cut off for most sites extended snippets. However, the tiny probability of inclusion for your website such beauty still exists. So it is a sin not to try!
Look, here’s an example found at Google for his own blog:
* – My blog is powered by WordPress, and create fake markings, I’ve included it here simply as an example of the layout.
This markup I instilled Dunno how long ago and had forgotten all about it, but it sometimes occurs, you see. As for what Google algorithm chooses where show star, I do not know, because marked all the posts, and the beautiful snippet shown for just a few posts and they are constantly changing.
By the way, please pay attention to the fact that I have a snippet, there are beautiful bread crumbs, but I do not mark up ‘, Google it himself identified and built into the snippet for all of my website. And what is even more interesting, I’ve seen a few examples of sites that have not been marked-star ratings, but Google still shows them in the snippet. Knowing all this, it becomes clear that especially something to manipulate these things will not work, the search engine will still make their own way.
No matter what we try, someone so lucky.
Modification rating news for DLE mikrorazmetku
Attention! Several conditions, failure of which leads to various problems and errors:
- These instructions apply to DLE versions 9.6 and 9.7. (For earlier versions, there are a couple of solutions in the comments, but I can not vouch for them.)
- Mandatory setting engine! Configuring user groups -> Guests -> tab “News” -> Enable of rating news: Yes.
- Output rating from category pages might disable, ie remove references to ratings from the template shortstory.tpl. Or you can do the following – # comment-13374 – but I would not recommend it.
So, we have finished the engine a few files to make things work the way we want it, as well as apply a few tricks, but first things first …
Begin, open the file / engine / modules / functions.php and find:
function ShowRating($id, $rating, $vote_num, $allow = true) {
 global $lang;

 ...

 return $rated;
}

function userrating($id) {
Where in my code should be three dots, there is a lot of code, I cut it, do not be important for us to find the beginning and the end.
Select the code I specified and replace it with the following:
function ShowRating($id, $rating, $vote_num, $allow = true) {
 global $lang;

 if( $rating AND $vote_num ) $rating = round( ($rating / $vote_num), 0 );
 else $rating = 4;
 $AVERrating = $rating;
 $rating = $rating * 17;

 if( !$allow ) {

  $rated = <<<HTML
<div>
  <ul>
  <li style="width:{$rating}px;">{$rating}</li>
  </ul>
</div>
HTML;

  return $rated;
 }

 $rated = <<<HTML
<div id='ratig-layer-{$id}'><div>
  <ul itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating">
  <li itemprop="average" style="width:{$rating}px;">{$AVERrating}</li>
  <li><a href="#" title="{$lang['useless']}" onclick="doRate('1', '{$id}'); return false;">1</a></li>
  <li><a href="#" title="{$lang['poor']}" onclick="doRate('2', '{$id}'); return false;">2</a></li>
  <li><a href="#" title="{$lang['fair']}" onclick="doRate('3', '{$id}'); return false;">3</a></li>
  <li><a href="#" title="{$lang['good']}" onclick="doRate('4', '{$id}'); return false;">4</a></li>
  <li itemprop="best"><a href="#" title="{$lang['excellent']}" onclick="doRate('5', '{$id}'); return false;">5</a></li>
  </ul>
</div></div>
HTML;

 return $rated;
}

function userrating($id) {
The code in the right places have added all the necessary tags, as well as used my little “trick”, which I’ll discuss shortly.
With this file finished – save and upload to the server, replacing the former.
Open the file / engine / modules / show.full.php and find the code:

  if( $row['allow_rate'] ) { 

   $tpl->set( '{rating}', ShowRating( $row['id'], $row['rating'], $row['vote_num'], $user_group[$member_id['user_group']]['allow_rating'] ) );
   $tpl->set( '{vote-num}', "<span id=\"vote-num-id-".$row['id']."\">".$row['vote_num']."</span>" );
   $tpl->set( '[rating]', "" );
   $tpl->set( '[/rating]', "" );

  } else {
Replace the code with the following:
if ( $row['vote_num'] == 0 ) $row['vote_num'] = 1;

  if( $row['allow_rate'] ) { 

   $tpl->set( '{rating}', ShowRating( $row['id'], $row['rating'], $row['vote_num'], $user_group[$member_id['user_group']]['allow_rating'] ) );
   $tpl->set( '{vote-num}', "<span itemprop=\"votes\" id=\"vote-num-id-".$row['id']."\">".$row['vote_num']."</span>" );
   $tpl->set( '[rating]', "" );
   $tpl->set( '[/rating]', "" );

  } else {
Save the file, upload to the server, replacing the previous version of the file.
It’s time to talk about “tricks” – it is this. If, for example, the news is very recent, then it is unlikely to have data on the rating, just one has cast a vote, and then the number of votes is equal to 0, and this is a mistake, well, that is, Google will tell you that we are deceiving and no rating we do not have. So, I modified the code so that if we have 0 votes, it is “as if” there is one voice, and it solves the problem with an error, the rating will be approved by Google.
And now, the files are modified engine, remained the final touch – add a rating to the template of our theme. Even if you have already shown in the rating patterns, it will have to seriously modify. In any case, I recommend my version, it is certainly working.
Open the file / templates / * name of your theme * / fullstory.tpl after {full-story} add the code:
[rating]<div itemscope itemtype="http://data-vocabulary.org/Review-aggregate"><div style="float:left;width:100px;">Рейтинг:</div>{rating}<div style="float:left;width:120px;">(голосов: {vote-num})</div></div>[/rating]
If suddenly it will appear crooked in your template, then, sorry, not my fault, please read already, finally, what is the CSS. And do not ask me questions in the comments, such as “help, all curves and move out, I am a complete noob.” Sooner or later, will still have to teach, and if not, will remain a moron and complete noobies. So do please favor …
Here is how it :) As simple as do the instructions, is not it?
It remains to check that everything is done correctly with the structured data verification tool Google.
Should get something like this:
Displaying extended snippet with a rating in Google
Once again, may I remind you that the probability of such a snippet shows how we check tool is extremely small, but it is!
More details about this option can be found in mikrorazmetki manuals Google. Also given all three to markup: microdata, microformats and RDFa. In the above case, I decided to use microdata is no fundamental difference between the two is no, they work the same way.
Now cross your fingers and dream that mikrorazmetka rankings like Google News, and he turned it. And there, and a serious increase in CTR, good traffic growth positions, mountains of dough … you are lying on a hammock, sipping a cocktail and watch the palm trees … Dream on, right?

Earnings More Money with Google Adsense

Earnings More Money with Google Adsense 

 

 

 

Hello Peaple (dearly Visitor)
Today we will know how we can get more money with google adsense by few tips
we will just talking for today and in the next post we going to show how it down with the wordpress and Joomla and datalife engine
How we can earning money with google?
Google ads are pricing computes Views and clicks.For this we must distribute advertisements well in Site Then targeted ads displayed to ensure greater clicks
We going to show you how we can do that in next posts so easy and with free stuff to help you as wp plugin and dle & joomla hacks so easy.
Discussed and engaged Please leave Comment
please keep visit
ads-first


add google adsense to wordpress

WordPress AdSense

Easy step to add fast google ads to your wordpress site
With WordPress you can easily add your AdSense code to your blog. In order to do this, first login to the administrative end of your website. Then, go to the Appearance -> Widgets menu.
adsense1

In this page select to drag-and-drop a “Text” widget onto your registered sidebar.
adsense2
Then you should add a title (in our case – Advertisement) and right under it the actual code that you have obtained from Google. Finally, click on the on the “Save” button right under it.
adsense3
Well done! You have just added your AdSense code to your WordPress blog.
Next Post show you how to add it in the top of the post see you!!

add google adsense anywhere you want!!

How to Insert Google Adsense Anywhere in Your Blog Post

Creating a shortcode

You need to add the following code into your functions.php file. You can do this in your dashboard, just go to ‘Appearance’ => ‘Editor’ open your functions.php file. Scroll-down to the end of this file and add this code in new line:
?
1
2
3
4
function adsenseads() {
    return '<div id="adsenseads">Put your Google Adsense banner code here</div>';
}
add_shortcode('showmyads', 'adsenseads');
Do it like on my screenshot:
Insert-Google-Adsense-Anywhere-Your-Blog-Post
Save your changes.

Showing Adsense ads anywhere in your posts

Now you can use this shortcode to insert Adsense into your post, just choose the place in your test and write the following code:
[showmyads]
You can use this WordPress shortcode in posts and pages.

Styling Your Banner

Your Adsense banner can be styled in your style.css file, because it is inserted with div element (id #adsenseads). You can add some merges, float parameters, etc.

Best of Google AdSense Plugins for WordPress 2013

Best of Google AdSense Plugins for WordPress 2013 

 

Best of Google AdSense Plugins for WordPress 2013

Google AdSense is one of the easiest ways to monetize your blog, but adding it to WordPress isn’t always the easiest thing to do.  Many people don’t know where to put the code or how to keep track of it.  Luckily there are lots of plugins that can simplify the process as well as provide more flexibility. Here are eight Google AdSense plugins for WordPress 2.5 and above.
As always, don’t install all of these unless you want to decrease your blog’s response time.
Google-Adsense-Wordpress-Plugins

Google AdSense Plugin

Google AdSense showcases Google ads

dSero Anti AdBlock for Google AdSense

Awesome Ads – Google Adsense and Others

Lys Creation Google Adsense (Plugin) Widget

Google Adsense Report PRO