<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PHP &#8211; Sibeesh Passion</title>
	<atom:link href="https://www.sibeeshpassion.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Fri, 17 Jul 2015 12:52:33 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>/wp-content/uploads/2017/04/Sibeesh_Passion_Logo_Small.png</url>
	<title>PHP &#8211; Sibeesh Passion</title>
	<link>https://www.sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to use shortcode inside any php file</title>
		<link>https://www.sibeeshpassion.com/how-to-use-shortcode-inside-any-php-file/</link>
					<comments>https://www.sibeeshpassion.com/how-to-use-shortcode-inside-any-php-file/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Fri, 17 Jul 2015 07:10:08 +0000</pubDate>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[How to use shortcode]]></category>
		<category><![CDATA[shortcode]]></category>
		<category><![CDATA[Using shortcode in PHP]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=7321</guid>

					<description><![CDATA[Hi, In this post we will see how we can use a short code inside a PHP file . You can do it by using the following line of code [php] &#60;?php echo do_shortcode(&#8216;[YOUR_SHORT_CODE_HERE]&#8217;);?&#62; [/php] kindest Regards Sibeesh Venu]]></description>
										<content:encoded><![CDATA[<p>Hi,<br />
In this post we will see how we can use a short code inside a PHP file . You can do it by using the following line of code</p>
<p>[php]<br />
&lt;?php echo do_shortcode(&#8216;[YOUR_SHORT_CODE_HERE]&#8217;);?&gt;<br />
[/php]</p>
<p>kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/how-to-use-shortcode-inside-any-php-file/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Add related posts in each posts in WordPress</title>
		<link>https://www.sibeeshpassion.com/add-related-posts-in-each-posts-in-wordpress/</link>
					<comments>https://www.sibeeshpassion.com/add-related-posts-in-each-posts-in-wordpress/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Tue, 14 Jul 2015 16:45:46 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Add a related posts in wordpress]]></category>
		<category><![CDATA[Add related posts in wordpress without plugin]]></category>
		<category><![CDATA[adding posts related to tags]]></category>
		<category><![CDATA[related posts in wordpress]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=7121</guid>

					<description><![CDATA[Introduction In this article we will learn how we will add related posts to each posts in wordpress according to the tags given. Even though there are so many plugins available to do the same, here I am going to show you a demo of implementing the same without a plugin. I hope you will like it. Background Today I was writing some articles in my website, once I finished my writing, I was just thinking about showing the related posts to each posts according to the tags selected. Hereby I will show you how we can implement it. Before [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><strong>Introduction</strong></p>
<p>In this article we will learn how we will add related posts to each posts in wordpress according to the tags given. Even though there are so many plugins available to do the same, here I am going to show you a demo of implementing the same without a plugin. I hope you will like it.</p>
<p><strong>Background</strong></p>
<p>Today I was writing some articles in my website, once I finished my writing, I was just thinking about showing the related posts to each posts according to the tags selected. Hereby I will show you how we can implement it. </p>
<p>Before going through it, we can do this in two way.</p>
<li>With a plugin </li>
<li>Without a plugin</li>
<p>I will always recommend you to use normal PHP, WordPress implementation which does not require any plugin. Do you know why?</p>
<p><strong>Limitations if use plugins</strong></p>
<li>It may change your theme style</li>
<li>It may not be supported your framework version</li>
<li>It may slow down your website</li>
<li>If you include a plugin, you are giving credits to the plugin author</li>
<li>Some plugins may have some internal redirects, it may cause unwanted loads</li>
<li>Some plugins add ads without your knowledge</li>
<p>These all problems will be resolved if you use normal few lines of PHP codes.</p>
<p>If you still need to go for a plugin, you can see some plugins here: <a href="https://wordpress.org/plugins/search.php?q=related+posts" target="_blank">Related Posts Plugins</a></p>
<p><strong>Using the code</strong></p>
<p>Since we need that related posts entry must be seen in each and every posts, we should make some changes in the file called single.php. You can either edit this file or create a widget.</p>
<p><img decoding="async" src="http://sibeeshpassion.com/content/images/Add_Related_posts_in_wordpress_1.png" alt="Add a related posts in wordpress" /></p>
<p><img decoding="async" src="http://sibeeshpassion.com/content/images/Add_Related_posts_in_wordpress_2.png" alt="Add a related posts in wordpress" /></p>
<p>Find out end of each posts, you can inspect one of your page elements in UI and find out the class name and search the same in the single.php file. For me it is class <em>post-excerpt</em>.</p>
<p>Now after that class ends, you need to paste the below lines of codes</p>
<p>[php]<br />
&lt;div class=&quot;relatedposts&quot;&gt;<br />
&lt;h3&gt;Related posts&lt;/h3&gt;<br />
&lt;?php<br />
    $orig_post = $post;<br />
    global $post;<br />
    $tags = wp_get_post_tags($post-&gt;ID);</p>
<p>    if ($tags) {<br />
    $tag_ids = array();<br />
    foreach($tags as $individual_tag) $tag_ids[] = $individual_tag-&gt;term_id;<br />
    $args=array(<br />
    &#8216;tag__in&#8217; =&gt; $tag_ids,<br />
    &#8216;post__not_in&#8217; =&gt; array($post-&gt;ID),<br />
    &#8216;posts_per_page&#8217;=&gt;5, // Number of related posts to display.<br />
    &#8216;caller_get_posts&#8217;=&gt;1<br />
    );</p>
<p>    $my_query = new wp_query( $args );</p>
<p>    while( $my_query-&gt;have_posts() ) {<br />
    $my_query-&gt;the_post();<br />
    ?&gt;</p>
<p>    &lt;div class=&quot;relatedthumb&quot;&gt;<br />
        &lt;a rel=&quot;external&quot; href=&quot;&lt;? the_permalink()?&gt;&quot;&gt;&lt;?php the_post_thumbnail(array(150,100)); ?&gt;&lt;br /&gt;<br />
        &lt;?php the_title(); ?&gt;<br />
        &lt;/a&gt;<br />
    &lt;/div&gt;</p>
<p>    &lt;? }<br />
    }<br />
    $post = $orig_post;<br />
    wp_reset_query();<br />
    ?&gt;<br />
&lt;/div&gt;<br />
[/php]</p>
<p>You can set your posts count in the below line of code.</p>
<p>[php]<br />
&#8216;posts_per_page&#8217;=&gt;5<br />
[/php]</p>
<p>Our next step is to add some css styles to the links.</p>
<p>[css]<br />
&lt;style&gt;<br />
.relatedthumb a {<br />
  color: #7a7a7a;<br />
  text-decoration: none;<br />
}<br />
.relatedthumb a:hover {<br />
  color: #01a821;<br />
}<br />
&lt;/style&gt;<br />
[/css]</p>
<p>You can either paste this CSS in <em>single.php</em> file or in <em>style.css</em></p>
<p>Now update your file, and run your website. Click on any post and see the output.</p>
<p>I have selected a post which is related to JQuery, and got the related posts as follows. It works great.</p>
<p><img decoding="async" src="http://sibeeshpassion.com/content/images/Add_Related_posts_in_wordpress_3.png" alt="Add a related posts in wordpress" /></p>
<p>Please be noted that you need to add tags in each posts, then only this mechanism works.</p>
<p>Reference: <a href="http://www.hongkiat.com/blog/wordpress-related-posts-without-plugins/" target="_blank">Related Posts</a></p>
<p><strong>Conclusion</strong></p>
<p>That is all. I hope you liked this article. Please share me your feedback.</p>
<p>Kindest Regards<br />
<a href="http://sibeeshpassion.com/" target="_blank">Sibeesh Venu</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/add-related-posts-in-each-posts-in-wordpress/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Calling an ASMX Web Service From Other Server Using jQuery and PHP</title>
		<link>https://www.sibeeshpassion.com/calling-an-asmx-web-service-from-other-server-using-jquery-and-php/</link>
					<comments>https://www.sibeeshpassion.com/calling-an-asmx-web-service-from-other-server-using-jquery-and-php/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Sun, 29 Dec 2013 19:25:46 +0000</pubDate>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Calling WebService in PHP]]></category>
		<category><![CDATA[WebService]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=681</guid>

					<description><![CDATA[Introduction A few months back, I got a requirement to fetch some inventory data from a server and show it to an HTML page. The interesting fact was the client server (the one that I want to show the data in) does not support .Net files. If did support them then we could directly add the web references and display the data. So what to do? I tried JSONP and Angular JSON but I could not make it to work. Then I came up with an idea. Here, I have: A web service that gets the data from the SQL [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><span style="color: #ff6600;">Introduction</span></p>
<p>A few months back, I got a requirement to fetch some inventory data from a server and show it to an HTML page. The interesting fact was the client server (the one that I want to show the data in) does not support .Net files. If did support them then we could directly add the web references and display the data. So what to do? I tried JSONP and Angular JSON but I could not make it to work. Then I came up with an idea.</p>
<p>Here, I have:</p>
<li>A web service that gets the data from the SQL Server 2008 DB in HTML format.</li>
<li>One HTML file where we need to show the data.</li>
<li>jQuery latest version JavaScript file.</li>
<p><span style="color: #ff6600;">Using the code</span></p>
<p>So let’s start</p>
<p><em>Make an HTML table in the file like the following:</em><br />
[html]<br />
&lt;table id=&quot;“inventory”&quot;&gt;<br />
&lt;tbody&gt;<br />
&lt;tr id=&quot;“maintr”&quot;&gt;<br />
&lt;th&gt;LOCATION&lt;/th&gt;<br />
&lt;th&gt;20 GP&lt;/th&gt;<br />
&lt;th&gt;40 FC&lt;/th&gt;<br />
&lt;th&gt;40 GP&lt;/th&gt;<br />
&lt;th&gt;40 OT&lt;/th&gt;<br />
&lt;th&gt;40 HCGP&lt;/th&gt;<br />
&lt;/tr&gt;<br />
&lt;/tbody&gt;<br />
&lt;/table&gt;<br />
[/html]</p>
<p>Add the JQuery reference.<br />
[js]<br />
&lt;script src=&quot;“js/jquery-1.9.1.js”&quot; type=&quot;“text/javascript”&quot;&gt;&lt;/script&gt;Add the styles to the table:<br />
[/js]</p>
<p>Add the following Scripts to get the data from the web service:<br />
[js]<br />
&lt;script type=&quot;“text/javascript”&quot;&gt;// &lt;![CDATA[<br />
        var gp20;<br />
        var gp40;<br />
        var fc40;<br />
        var ot40;<br />
        var hcgp40;<br />
        $(document).ready(function () {<br />
            $(“#accordion”).accordion();<br />
            $.post(“RetWS.php”, {<br />
                action: “test”<br />
            },<br />
            function (data) {<br />
                var className;<br />
                var i = 0;<br />
                var xdoc = $.parseXML(data),<br />
                $xml = $(xdoc);<br />
                $($xml).find(‘AvailableSaleUnitsDetail’).each(function () {<br />
                    if (i % 2 != 0) {<br />
                        className = ‘alt’;<br />
                    }<br />
                    else {<br />
                        className = ‘normal’;<br />
                    }<br />
                    if (parseInt($(this).find(‘_x0032_0GP’).text()) &gt; 50) {<br />
                        gp20 = ’50 +’;<br />
                    }<br />
                    else {<br />
                        gp20 = $(this).find(‘_x0032_0GP’).text();<br />
                    }<br />
                    if (parseInt($(this).find(‘_x0034_0FC’).text()) &gt; 50) {<br />
                        fc40 = ’50 +’;<br />
                    }<br />
                    else {<br />
                        fc40 = $(this).find(‘_x0034_0FC’).text();<br />
                    }<br />
                    if (parseInt($(this).find(‘_x0034_0GP’).text()) &gt; 50) {<br />
                        gp40 = ’50 +’;<br />
                    }<br />
                    else {<br />
                        gp40 = $(this).find(‘_x0034_0GP’).text();<br />
                    }<br />
                    if (parseInt($(this).find(‘_x0034_0OT’).text()) &gt; 50) {<br />
                        ot40 = ’50 +’;<br />
                    }<br />
                    else {<br />
                        ot40 = $(this).find(‘_x0034_0OT’).text();<br />
                    }<br />
                    if (parseInt($(this).find(‘_x0034_0HCGP’).text()) &gt; 50) {<br />
                        hcgp40 = ’50 +’;<br />
                    }<br />
                    else {<br />
                        hcgp40 = $(this).find(‘_x0034_0HCGP’).text();<br />
                    }<br />
                    $(“#inventory”).append(“</p>
<p>&lt;tr class=” + className + ” &gt;<br />
&lt;td id=” + $(this).find(‘Location’).text() + “&gt;” + $(this).find(‘Location’).text() + “&lt;/td&gt;<br />
&lt;td&gt;” + gp20 + “&lt;/td&gt;<br />
&lt;td &gt;” + fc40 + “&lt;/td&gt;<br />
&lt;td&gt;” + gp40 + “&lt;/td&gt;<br />
&lt;td &gt;” + ot40 + “&lt;/td&gt;<br />
&lt;td &gt;” + hcgp40+ “&lt;/td&gt;<br />
&lt;/tr&gt;<br />
”);                    i++;<br />
                });<br />
            })<br />
        });</p>
<p>// ]]&gt;<br />
&lt;/script&gt;<br />
[/js]</p>
<p>Here, <em>RetWS.php</em> is my PHP file that actually gets the data from an asmx web service from another server.</p>
<p>In the <em>RetWs.php</em> you can do the following codes:<br />
[php]<br />
&lt;!&#8211;?php if(isset($_POST[‘action’]) &amp;amp;&amp;amp; !emptyempty($_POST[‘action’])) {     $action = $_POST[‘action’];     switch($action) {         case ‘test’ : doWebService();         break;     } } function doWebService() {   $client = new SoapClient(“http://Here paste link to your webservice”);   echo $client-&amp;gt;getInventoryForWs()-&amp;gt;getInventoryForWsResult;&amp;lt;br ?&#8211;&gt; }<br />
?&amp;gt;<br />
[/php]</p>
<p>The link may look like:</p>
<p><em>http://www.something.com/Reports/Marketing/Mywebservice.asmx?WSDL</em><br />
Make sure that there are no spelling mistakes.</p>
<p>Kindest Regards<br />
Sibeesh Vennu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/calling-an-asmx-web-service-from-other-server-using-jquery-and-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
