Surinder Goswami | Create Your Badge

I wish to introduce myself as an individual who is always ready to learn something new and is very creative and inventive in nature. I was born and brought up in a loving, caring and religious family where I was taught the value of honesty and sincerity. I hail from Kurali(Punjab), I belongs to middle class family. I am always taught to pay prime importance to ethical and personal values of love, peace and sincerity. All members of my family are not educated and personal aim of my life is to place myself in a better position in the ever expanding corporate world.
My father has been a source of inspiration throughout my education. My parents’ support has always made me strong and encouraged me from time to time to face the big challenges in my life. In order to strengthen my goal, I have worked very hard in academics, extra curricular activities to achieve my personal development and lead my career in a meaningful way.

While making a custom wordpress theme from static html, sometime we need to show shortcode within our template file for a image gallery or for some other plugin.
Wordpress provide a custom builtin funcion that parse the shortcode to required result.

Syntax: <?php do_shortcode(‘[your shorcode goes here]‘); ?>

Example:
<?php echo do_shortcode(‘[shortcode id=id]‘); ?>

You can use the same code withn the widgets, but in order to parse php within widgets you have to install a plugin like “Exec-PHP” to parse php.Then use text widget and write the same syntax written above to get the desired result.

These days social media is one of the main concern to increase website traffic or to popular once website. Facebook provides  sharing and like button  that can be embeded into any website or CMS with ease, It is good to let your visitors share content on your blog using their Facebook profile. It is  easy to use –  copying this snippet of code into your website and enjoy.

1. For WordPress

If you need to share your each blog  post to facebook, then simply copy and past the below code inside the while loop responsible for displaying all your blog posts or if you are displaying posts from one category.
<?php if(have_posts()):
while(have_posts()): the_post();
the_title();
the_content();
?>
<a href=”http://www.facebook.com/sharer.php?u=&lt;?php the_permalink();?>&t=<?php the_title(); ?>” title=”Facebook share button” target=”blank”>Share on Facebook</a>
<?php
endwhile;
endif;
?>

2. To embed into any website.

<?php
$current_url =”http://mywebsite.com&#8221;;
$current_title = “my custom title”;
?>
<a href=”http://www.facebook.com/sharer.php?u=&lt;?php echo $current_url; ?>&t=<?php echo $current_title; ?>” title=”Facebook share button” target=”blank”>Share on Facebook</a>

Note: To  pass custom parameters to a Facebook – Share button.

The default code script for Facebook share buttton,  Most of the time we need to pass our custom link and title. But this code does not work as expected. When share link is clicked the link from “u” parameter is passed but not the title from “t” parameter.
But  facebook actually uses standard content title, description, and images from meta-tags from the page that is going to shared.
The default code with stanadard paramertes “u” and “t”;

<a title=”Share this post/page title”
href=”http://www.facebook.com/sharer.php? u=http://mywebisite.com/mypage.php &t=my custom title”
target=”_blank”>
<img src=”path to image use as a link”
alt=”Share on Facebook” />
</a>
But we need different titles and descriptions for each post/page that is  going to be shared.
Here is a way that tells facebook what url, title and images to description to use for share button.

<a title=”Share this post/page”
href=”http://www.facebook.com/sharer.php?
s=100
&p[url]=url to share post/page
&p[images][0]=path to image
&p[title]=my custom title
&p[summary]=summery content”
target=”_blank”>
<img src=”path to image use as a link”
alt=”Share on Facebook” />
</a>

WordPress Knowledge Base:

1. How to call a single post in wordpress template?

Answer:
Wordpress function: get_post($post_id,$output);
$post_id = id of post to get content
$output = OBJECT- default an object
ARRAY_A-returns an associative array of filed names to values
ARRAY_N- returns numeric array of field values

Example 1:
$postId  = 1;
$data = get_post($postId);
$postTitle = $data->post_title;
$postContent = $data->post_content;

Example 2:
$postId  = 1;
$data = get_post($postId,ARRAY_A);
$postTitle = $data-[‘post_title’];
$postContent = $data[‘post_content’];

Returned Fields are:

ID (integer) The post ID
post_author (integer) The post author’s ID
post_date (string) The datetime of the post (YYYY-MM-DD HH:MM:SS)
post_date_gmt (string) The GMT datetime of the post (YYYY-MM-DD HH:MM:SS)
post_content (string) The post’s contents
post_title (string) The post’s title
post_category (integer) The post category’s ID. Note that this will always be 0 (zero) from wordpress 2.1 onwards. To determine a post’s category or categories, use get_the_category().
post_excerpt (string) The post excerpt
post_status (string) The post status (publish|pending|draft|private|static|object|attachment|inherit|future|trash)
comment_status (string) The comment status (open|closed|registered_only)
ping_status (string) The pingback/trackback status (open|closed)
post_password (string) The post password
post_name (string) The post’s URL slug
to_ping (string) URLs to be pinged
pinged (string) URLs already pinged
post_modified (string) The last modified datetime of the post (YYYY-MM-DD HH:MM:SS)
post_modified_gmt (string) The last modified GMT datetime of the post (YYYY-MM-DD HH:MM:SS)
post_content_filtered (string)
post_parent (integer) The parent post’s ID (for attachments, etc)
guid (string) A link to the post. Note: One cannot rely upon the GUID to be the permalink (as it previously was in pre-2.5), Nor can you expect it to be a valid link to the post. It’s merely a unique identifier, which so happens to be a link to the post at present.
menu_order (integer)
post_type (string) (post|page|attachment)
post_mime_type (string) Mime Type (for attachments, etc)
comment_count (integer) Number of comments

Hi friends, In this post you will find a lot of wordpress tricky codes and functions that will help you for your wordpress rapid theme development.
I have collected wordpress useful stuff that will help beginners a lot. As all you know we need some resource to read from or if we can find some friend who can help.
I am here to help all my friends who want to be a wordpress theme developer. Here are some images that have much information for wordpress lovers. You can check and please send me your valuable feedback how can I improve this blog and if you have any question regarding wordpress theme development.

Hi friends, We usually search stuff for wordpress when we start a new wordpress project at that time we have lot of questions like

  1. how to make a theme and a sub theme.
  2. how to show posts from a single category.
  3. how to call a single post content or how to show single post from a specific category on home page etc.
  4. how to develop a best photo blog.
  5. how to setup facebook integration.

I have started this blog to help all such php developers who are new in this field and have a lot of questions how to start using wordpress.
Check this image this will help you a lot when you start making a new theme or child theme.