{"id":27440,"date":"2017-01-11T03:01:19","date_gmt":"2017-01-10T17:01:19","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=27440"},"modified":"2017-01-10T13:09:27","modified_gmt":"2017-01-10T03:09:27","slug":"wordpress-theme-lookup-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-theme-lookup-primer-tutorial\/","title":{"rendered":"WordPress Theme Lookup Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_wordpress_theme_is_that.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"WordPress Theme Lookup Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_wordpress_theme_is_that.JPG\" title=\"WordPress Theme Lookup Primer Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">WordPress Theme Lookup Primer Tutorial<\/p><\/div>\n<p>Maybe you have been following our recent exploits with <a target=_blank title='Apache\/PHP\/MySQL local web server MAMP home page' href='http:\/\/mamp.info'>MAMP<\/a> on Windows, are curious, but have no experience with PHP?  Today&#8217;s tutorial might be right down your alley.<\/p>\n<p>All the &#8220;parts&#8221; to today&#8217;s &#8220;What WordPress Theme is That&#8221; web application we&#8217;ve written in PHP in its first incarnation is largely shown by today&#8217;s one <a target=_blank title='Tutorial picture' href='http:\/\/www.rjmprogramming.com.au\/PHP\/what_wordpress_theme_is_that.JPG'>tutorial picture<\/a>.<\/p>\n<p>After you install (and start) MAMP on Windows as we show below with <a title='MAMP on Windows Primer Tutorial' href='#mowpt'>MAMP on Windows Primer Tutorial<\/a> you establish &#8230;<\/p>\n<ul>\n<li>Document Root as a Windows folder associated with (local Apache\/PHP\/MySQL web server) MAMP http:\/\/localhost:8888\/ URL, in our case C:\\MAMP\\htdocs\\<\/li>\n<li>Connection method to a local MySQL database we point at via localhost:8899<\/li>\n<\/ul>\n<p> &#8230; but this does not guarantee that the path to MAMP&#8217;s <i>php<\/i>.exe engine is on the PATH, and to have it on the PATH is a good idea, because when doing PHP code development, one of the easiest and fast validation techniques (to perhaps check) before testing on a web browser is via, for the code case today, at a Windows command line prompt in C:\\MAMP\\htdocs\\ &#8230;<\/p>\n<p><code>php -l what_wordpress_theme_is_that.php<\/code><\/p>\n<p>We saw this not working, and made it work, for us, with PHP version 5.4.45 &#8230;<\/p>\n<p><code>set PATH=C:\\MAMP\\bin\\php5.4.45\\;%PATH%<br \/>\n php -l what_wordpress_theme_is_that.php<\/code><\/p>\n<p>Hopefully, by the name of this web application you know what it is doing.  At a basic level, and that&#8217;s all we get to today, we are asking the web application to determine, for an &#8220;inputted&#8221; URL, whether that URL is &#8230;<\/p>\n<ul>\n<li>WordPress blog webpage &#8230; and then &#8230;<\/li>\n<li>WordPress theme name it is using<\/li>\n<\/ul>\n<p>In these early days, we&#8217;ve coded for two, and only two,  execution scenarios &#8230;<\/p>\n<ol>\n<li>An address bar URL of <a target=_blank title=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_wordpress_theme_is_that.php\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_wordpress_theme_is_that.php\">http:\/\/www.rjmprogramming.com.au\/PHP\/what_wordpress_theme_is_that.php<\/a> is entered, and the web application will present an HTML form for the user to fill in the URL of interest to them &#8230; which kicks of &#8230;<\/li>\n<li>An address bar URL like <a target=_blank title=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_wordpress_theme_is_that.php?url=https:\/\/www.rjmprogramming.com.au\/ITblog\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_wordpress_theme_is_that.php?url=https:\/\/www.rjmprogramming.com.au\/ITblog\">http:\/\/www.rjmprogramming.com.au\/PHP\/what_wordpress_theme_is_that.php?url=https:\/\/www.rjmprogramming.com.au\/ITblog<\/a> is presented to the web browser address bar &#8230; and a result here would be &#8230;<br \/>\n<code>Twenty Ten is the WordPress theme used by https:\/\/www.rjmprogramming.com.au\/ITblog<\/code>\n<\/li>\n<\/ol>\n<p> &#8230; and yes, did check <i>http:\/\/www.rjmprogramming.com.au\/PHP\/what_wordpress_theme_is_that.php?url=http:\/\/localhost:8888\/wordpress<\/i> and it did return <i>Twenty Seventeen is the WordPress theme used by http:\/\/localhost:8888<\/i> as expected.<\/p>\n<p>As you would surmise, at this early stage with the PHP code you could call <a target=_blank title=\"what_wordpress_theme_is_that.php\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_wordpress_theme_is_that.php_GETME\">what_wordpress_theme_is_that.php<\/a> that it is fairly simple, and that is true, but it does use some PHP favourite methods of ours, namely &#8230;<\/p>\n<ul>\n<li><a target=_blank title='PHP file_get_contents method information' href='http:\/\/php.net\/manual\/en\/function.file-get-contents.php'>file_get_contents<\/a> is used to ascertain the HTML of the URL the user is interested in &#8230; and <\/li>\n<li><a target=_blank title='PHP strpos method information' href='http:\/\/php.net\/manual\/en\/function.strpos.php'>strpos<\/a> is used to find one string within another, or not<\/li>\n<li><a target=_blank title='PHP explode method information' href='http:\/\/php.net\/manual\/en\/function.explode.php'>explode<\/a> is used to split up a string into delimited separated parts of an outputted array<\/li>\n<\/ul>\n<p>Get good at PHP and you can achieve a lot, in a short space of code and\/or time.  With server side code you find that you start looking at achievable approaches you&#8217;d never dreamed of before, if you&#8217;d just been doing exclusively client based web applications in HTML and Javascript, and even Ajax, but perhaps not Node.js where Javascript can be like your server side code &#8230; amazing, huh?!<\/p>\n<hr>\n<p id='mowpt'>Previous relevant <a target=_blank title='MAMP on Windows Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/mamp-on-windows-primer-tutorial\/'>MAMP on Windows Primer Tutorial<\/a> <\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/MAMP\/mamp_windows_4.JPG\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"MAMP on Windows Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/MAMP\/mamp_windows_4.JPG\" title=\"MAMP on Windows Primer Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">MAMP on Windows Primer Tutorial<\/p><\/div>\n<p>Have you noticed when you revisit websites from long ago lots of times functionality regarding platform flexibility has moved on.  Web server products in particular are of more benefit to us all if they support multiple platforms.<\/p>\n<p>In that regard we are happy to break a &#8220;myth&#8221; that had developed in my mind that the wonderful <a target=_blank title='MAMP local Apache\/PHP\/MySQL web server' href='http:\/\/mamp.info'>MAMP<\/a> local Apache\/PHP\/MySQL web server was just for use with Mac OS X.   It might have been me dreaming, but in any case, it can be used on Windows, currently version 3.2.2.<\/p>\n<p>It behoves us, though, to take a step back and explain why this interest?  Let&#8217;s just take the concept of a local web server first.  We think &#8230;<\/p>\n<blockquote><p>\nLocal web servers are the best way to test code destined for a real and live web server open to the public to test web applications both for the logic and coding within them, and to get close to testing for similar environmental circumstances\n<\/p><\/blockquote>\n<p> &#8230; and sorry to break it to you, but short of <a target=_blank title='Ansible home page' href='https:\/\/www.ansible.com\/'>Ansible<\/a> type of <a target=_blank title='Ansible blog postings here' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/ansible'>deployment thinking<\/a> it is not good to be more definitive about &#8220;environmental&#8221; simulation, than the sentence above.  Think it&#8217;s not worth this &#8220;local web server&#8221; bother?  For all else, but totally trivial coding, like you may be able to achieve via Javascript, within a blog posting itself (and this is not really advised by the big players anyway), it is just not a good idea not to have tested a web application locally first, especially if it is a serverside language like PHP or ASP.Net &#8230; and yes, noticed with the MAMP on Windows install, that .Net Framework comes into the equation.<\/p>\n<p>Now let&#8217;s &#8220;plonk&#8221; on top of that in our thinking, and this is the motivation for a lot of user interest out there, what about &#8220;how to go about developing a WordPress blog from go to wo (hopefully not woe &#8230; <font size=1>chortle, chortle<\/font>)&#8221;?  The same goes here in our mind &#8230;<\/p>\n<blockquote><p>\nLocal web servers are the best way to test products you install from third parties, such as blogs and forums and chatrooms and <a target=_blank title='Customer Relationship Management' href='https:\/\/en.wikipedia.org\/wiki\/Customer_relationship_management'>CRM<\/a> and <a target=_blank title='Content Management System' href='https:\/\/en.wikipedia.org\/wiki\/Content_management_system'>CMS<\/a> websites, destined for a real and live web server open to the public to test web applications both for the logic and coding within them, and to get close to testing for similar environmental circumstances\n<\/p><\/blockquote>\n<p> &#8230; to which it would be legitimate to question, given web server interfacings like <a target=_blank title='cPanel home page' href='http:\/\/cpanel.com\/'>cPanel<\/a> (hosting platform) to go with managing an Apache\/PHP\/MySQL web server, that that sounds like &#8220;overkill&#8221; given cPanel has options to install blog products like WordPress within its menus.  We would say to that, that, yes, it has a good chance of working if you use cPanel, that is true, but we would see that it is not going backwards, nor costing any money, with a lot of the products, to &#8220;test run&#8221; them on a local web server, and when satisfied, or not, use cPanel, or some other (s)ftp file transfer approach to get that product up live and running.<\/p>\n<p>Add to that for us, is that we&#8217;ve had only the smallest of working problems with MAMP on Mac OS X for many years now, and so we&#8217;d have to describe it as &#8220;robust&#8221;, and it has an associated MySQL database interface product called <a target=_blank title='phpMyAdmin home page'>phpMyAdmin<\/a> which is so good it&#8217;s thinking of inventing a &#8220;phpMyAdmin soup&#8221;.<\/p>\n<p>So that leaves, for us, why move off the <a target=_blank title='EasyPHP home page' href='http:\/\/www.easyphp.org\/'>EasyPHP<\/a> (local (WAMP) Apache\/PHP\/MySQL web server) for Windows product.  After all, we readily admit to <a target=_blank title='EasyPHP blog postings here' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/easyphp\/'>no issues with EasyPHP<\/a> here, but we feel that to progress with knowledge, and not let &#8220;platform confusion&#8221; overcome you, you should learn as much as possible about what is out there as an alternative.  After all, even though it may not work with your Windows, it did for me, to have the following MAMP ports hold true &#8230;<\/p>\n<ul>\n<li>Apache listener on port 8888<\/li>\n<li>MySQL listener had a clash on our preferred port 8889 (like it is for Mac OS X), but we had no problem with using port 8899<\/li>\n<\/ul>\n<p> &#8230; which, to many many intents and purposes makes your work coming off Mac OS X local web server work, look heaps (&#8220;exactly&#8221;, if no MySQL connections involved in the code) like your work, perhaps, moving over to, or even integrating with a Windows local web server with the same &#8220;MAMP&#8221; (robust) product name.<\/p>\n<p>In short, if you &#8220;want to learn&#8221; WordPress I&#8217;d recommend, strongly, the use of a local Apache\/PHP\/MySQL web server product like MAMP, whether you are using Mac OS X or Windows.<\/p>\n<p>In long trousers, now, if you &#8220;want to learn&#8221; WordPress I&#8217;d recommend, strongly, to learn some HTML.  If you have a local web server, and install WordPress to a local web server, and you are only starting out with PHP, there is a double whammy advantage that you will see PHP WordPress code they talk about at <a target=_blank title='WordPress Codex home page' href='https:\/\/codex.wordpress.org\/'>WordPress Codex<\/a>, the online manual for WordPress code.<\/p>\n<\/p>\n<p>But to today, and all we did, was &#8230;<\/p>\n<ul>\n<li>Visited the <a target=_blank title='MAMP local Apache\/PHP\/MySQL web server' href='http:\/\/mamp.info'>MAMP<\/a> website &#8230; noticed its Windows interface &#8230; new to us &#8230; so &#8230;<\/li>\n<li>Got on Windows &#8230; and installed &#8230;<br \/>\n<img src='http:\/\/www.rjmprogramming.com.au\/MAMP\/mamp_windows.JPG' title='MAMP on Windows install 1 of 2'><\/img><br \/>\n<img src='http:\/\/www.rjmprogramming.com.au\/MAMP\/mamp_windows_2.JPG' title='MAMP on Windows install 2 of 2'><\/img>\n<\/li>\n<li>Started it up and realized Apache started but MySQL didn&#8217;t &#8230; so did a bit of research at <a target=_blank title='Useful link' href='http:\/\/stackoverflow.com\/questions\/19482371\/fix-access-denied-for-user-rootlocalhost-for-phpmyadmin'>this useful link<\/a>, thanks &#8230;and so &#8230;<\/li>\n<li>Changed MAMP Properties so that MySQL listener port would be changed from the 8889 we had to 8899 &#8230; restarted &#8230; success<\/li>\n<\/ul>\n<p>Below is another way to summarize the work above &#8230; in picture<strike>s<\/strike> &#8230; yes, an animated GIF, so popular on websites like <a target=_blank title='Tumblr' href='http:\/\/www.tumblr.com'>Tumblr<\/a> &#8230; and able to be constructed quite well on <a target=_blank title='Gifpal' href='http:\/\/gifpal.com'>Gifpal<\/a>, but, today, we are showing you having been constructed inhouse via the techniques that feature PHP writing PHP of <a title='Animated GIF via PHP Writing PHP Primer Tutorial' href='#agvpwppt'>Animated GIF via PHP Writing PHP Primer Tutorial<\/a> &#8230; for your perusal &#8230;<\/p>\n<p><img src='http:\/\/www.rjmprogramming.com.au\/MAMP\/mamp_windows.gif' title='MAMP on Windows Animated GIF style'><\/img><\/p>\n<hr>\n<p id='agvpwppt'>Previous relevant <a target=_blank title='Animated GIF via PHP Writing PHP Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/animated-gif-via-php-writing-php-primer-tutorial\/'>Animated GIF via PHP Writing PHP Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Animated GIF via PHP Writing PHP Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/animated_gif-186of.jpg\" title=\"Animated GIF via PHP Writing PHP Primer Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">Animated GIF via PHP Writing PHP Primer Tutorial<\/p><\/div>\n<p>We find another very useful reason for PHP to write PHP.  Today we establish a PHP web application to dynamically create Animated GIF images via some still images, like <a target=_blank title='Gifpal' href='http:\/\/www.gifpal.com'>Gifpal<\/a> would do.<\/p>\n<p>We have some great open source PHP code to thank for the basis of the functionality we found at Jeroen van Wissen&#8217;s very <a target=_blank href='http:\/\/www.jeroenvanwissen.nl\/weblog\/php\/howto-generate-animated-gif-with-php'>useful link<\/a>, thanks.<\/p>\n<p>Then we added a more user friendly interface to get the information off the user we need.   We present this in an HTML form, which navigates to the same PHP to do the actual assembly of the Animated GIF via techniques where PHP writes PHP &#8230; and really needs to, to be useful.<\/p>\n<p>Do you remember, last, when we did some PHP writing PHP functionality &#8230; <a target=_blank title='PHP Writes PHP Vertical TextBoxes Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/php-writes-php-vertical-textboxes-primer-tutorial\/'>PHP Writes PHP Vertical TextBoxes Primer Tutorial<\/a>?<\/p>\n<p>And inside the PHP it makes big use of the <a target=_blank title='GD and Image Functions' href='http:\/\/php.net\/manual\/en\/ref.image.php'>GD and Image Functions<\/a> to read and write the image data we assemble via the user information.<\/p>\n<p>This Animated GIF form of animation is the easiest to implement, as it consists of just the one GIF image file, but the user has very little control over the animation settings, such as the delay between stills, one of the settings we ask about in our web application.<\/p>\n<p>Our PHP source code today you could call <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/tutorial_to_animated_gif.php_GETME\" title='tutorial_to_animated_gif.php'>tutorial_to_animated_gif.php<\/a> and we redirect you to some live run ideas &#8230;<\/p>\n<ul>\n<li>normal run with HTML form which posts back to itself &#8230; <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/tutorial_to_animated_gif.php\" title='live run'>live run<\/a><\/li>\n<li>example GET parameters <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/tutorial_to_animated_gif.php?delay=500&#038;stitle=PaintBrush%20Panning%20Primer%20Tutorial&#038;slideshow=http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/index.html\" title='get parameters live run'>run<\/a> (like our tutorial picture)<\/li>\n<\/ul>\n<p>Hope you find this tutorial useful.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d17197' onclick='var dv=document.getElementById(\"d17197\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/category\/animation\/\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d17197' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d27319' onclick='var dv=document.getElementById(\"d27319\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/mamp\/\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d27319' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d27440' onclick='var dv=document.getElementById(\"d27440\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/php\/\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d27440' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Maybe you have been following our recent exploits with MAMP on Windows, are curious, but have no experience with PHP? Today&#8217;s tutorial might be right down your alley. All the &#8220;parts&#8221; to today&#8217;s &#8220;What WordPress Theme is That&#8221; web application &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-theme-lookup-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,37],"tags":[85,234,1750,358,429,576,714,744,2120,932,997,1268,1319,1345,1435,1456],"class_list":["post-27440","post","type-post","status-publish","format-standard","hentry","category-elearning","category-tutorials","tag-apache","tag-command-line","tag-document-root","tag-dos","tag-file_get_contents","tag-html","tag-local-web-server","tag-mamp","tag-path","tag-php","tag-programming","tag-theme","tag-tutorial","tag-url","tag-windows","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/27440"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=27440"}],"version-history":[{"count":11,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/27440\/revisions"}],"predecessor-version":[{"id":27451,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/27440\/revisions\/27451"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=27440"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=27440"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=27440"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}