{"id":241,"date":"2010-08-06T17:39:28","date_gmt":"2010-08-07T01:39:28","guid":{"rendered":"http:\/\/jasonmcreynolds.com\/?p=241"},"modified":"2015-10-16T12:05:13","modified_gmt":"2015-10-16T20:05:13","slug":"hacking-the-arras-theme","status":"publish","type":"post","link":"https:\/\/jasonmcreynolds.com\/?p=241","title":{"rendered":"Hacking the Arras Theme"},"content":{"rendered":"<p>First off, I have to say that I love the Arras Theme and think it&#8217;s the coolest one out there. The other day I was adding some content to my site and I hadn&#8217;t upgraded to WordPress 3.0 yet so I decided to do the upgrade. I usually like to upgrade all the plugins and themes that have upgrades available before I upgrade WordPress just to make sure things are\u00a0compatible. However, after upgrading WordPress and the Arras Theme I found that things didn&#8217;t quite look the way they did before the upgrades. Some of my issues were because I didn&#8217;t bother to check theme settings\u00a0or save theme files that I had modified\u00a0before I updated the theme. In my defense, I must say it had been a long time since I had setup the theme and had pretty much forgotten what I had done to customize it (yeah, it&#8217;s a lame defense ;)). \u00a0Anyway, here&#8217;s a list of what was different after the upgrades:<\/p>\n<ul>\n<li>PHP errors on page because it was using PHP4, not PHP5<\/li>\n<li>Colors were different<\/li>\n<li>Links for pages across the top (Home, Resume, etc.) were missing<\/li>\n<li>Thumbnails were not displaying in the actual posts<\/li>\n<li>No picture in the header<\/li>\n<\/ul>\n<p>Some of these were pretty obvious, but I&#8217;ll go through each one so I can save myself time the next time I need to do this. \ud83d\ude42<\/p>\n<p><!--more--><\/p>\n<p><strong>PHP errors on page because it was using PHP4, not PHP5<\/strong><br \/>\nThis was resolved with a simple .htaccess file that I needed to configure on the server the site is hosted on. By default it uses PHP4 but a lot of stuff is using PHP5 now. The fix was easy, I just needed to create a .htaccess file in the site&#8217;s root directory and add the following line to it:<\/p>\n<pre class=\"toolbar:1 lang:default decode:true\">AddType x-mapp-php5 .php<\/pre>\n<p><strong>Colors were different<\/strong><\/p>\n<p>The site background color and the background color for the tables was different. Since I didn&#8217;t bother to check or document what they were before I updated the theme I didn&#8217;t remember what they were. So, I just forged ahead, kicking myself for not heeding that little thought that said I should take some screenshots and check settings before I did the upgrade. I didn&#8217;t think the upgrade would really change much. Oh well, I learned. First off, I needed to change the backgroud color in the &#8220;Custom Background&#8221; section under the &#8220;Arras Theme&#8221;. I just clicked the &#8220;Background Color&#8221; box and\u00a0fiddled\u00a0with the color chooser until I found something I liked. Next I wanted to change the background of the tables and after some fiddling I figured out that the color was f7f6f0 and the setting was located in &#8220;wp-content\/themes\/arras-theme\/css\/styles\/default.css&#8221;. The line that I changed was:<\/p>\n<pre class=\"toolbar:1 lang:css decode:true\">#main { padding: 10px 10px 0; background: #f7f6f0; border: 1px solid #d3d1c7; }<\/pre>\n<p>I changed the background to #FFFFFF and then I\u00a0then noticed that I needed to change it for the footer too and that was done by modifing the following line of the above mentioned file:<\/p>\n<pre class=\"toolbar:1 lang:css decode:true\">#footer { margin: 20px auto 0; width: 980px; background: #ECEBE6; padding-bottom: 10px; border: 1px solid #CCC; }<\/pre>\n<p>I changed the background to #FFFFFF and then I was good to go. I&#8217;m not sure I like the white but at least I know where to go to change it now.<\/p>\n<p><strong>Links for pages across the top (Home, Resume, etc.) were missing<\/strong><\/p>\n<p>This one was a little strange, but I figured it out. I went to &#8220;Appearence &gt; Menus&#8221; anc created a new menu named &#8220;Nav Bar&#8221; and then dragged the links for the Pages that I wanted displayed for the Pages section on the left to the new Nav Bar I had created on the right. After doing that they appeared.<\/p>\n<p><strong>Thumbnails were not displaying in the actual posts<\/strong><\/p>\n<p>To display the thumbnail image on each post, but not on each page, I found a nice little post from\u00a0<a title=\"Hide the Arras Theme header image in pages\" href=\"http:\/\/www.mitchellenright.com\/2010\/07\/11\/hide-arras-theme-header-image-on-pages\/\" target=\"_blank\">IT by MITCH<\/a>. It&#8217;s a two step process. First you need to edit some of the config files for the Arras Theme and then you need to add a custom field on the post\/page you don&#8217;t want the thumbnail to be displayed.<\/p>\n<p>For the first part, the code, do the following (for me, the file is located in &#8220;wp-content\/themes\/arras-theme&#8221;:<\/p>\n<ul>\n<li>In Functions.php, add the following line:\n<pre class=\"toolbar:1 lang:php decode:true\">Define( ARRAS_DONT_DISPLAY_THUMB, 'dontdisplaythumbinpost');<\/pre>\n<\/li>\n<li>In library\/template.php (for me it&#8217;s in &#8220;wp-content\/themes\/arras-theme\/library&#8221;, find the line:\n<pre class=\"toolbar:1 lang:php decode:true\">if ($post) $id = $post-&gt;ID;<\/pre>\n<\/li>\n<li>Add the following code after the above mentioned line:\n<pre class=\"toolbar:1 lang:php decode:true\">$dontdisplaythumbinpost = get_post_meta($post-&gt;ID, ARRAS_DONT_DISPLAY_THUMB, true);\r\nif ($dontdisplaythumbinpost) {\r\nreturn false;\r\n}<\/pre>\n<\/li>\n<\/ul>\n<p>Once I did the above, all I had to do was create a custom field on the page I didn&#8217;t want to have the thumbnail displayed. Once it&#8217;s created you can then just select it form the\u00a0drop-down menu under Custom Fields for any of the other Pages or Posts you don&#8217;t want the thumbnail displayed on. To create it, go to\u00a0a Page (or a Post) and under &#8220;Custom Fields&#8221; click &#8220;Enter new&#8221; and under Name put &#8220;dontdisplaythumbinpost&#8221; and under value put &#8220;1&#8221;. Once that was done I could select it on the Pages I wanted and set it to &#8220;1&#8221; so the thumbnails wouldn&#8217;t show.<\/p>\n<p><strong>No picture in the header<\/strong><\/p>\n<p>To add a picture (background) to the header, I found a <a title=\"Arras THeme - Header with picture\" href=\"http:\/\/wordpress.org\/support\/topic\/arras-theme-header-with-picture\" target=\"_blank\">post <\/a>on the WordPress forums (that I think I used when I first set the theme up ;)) that explains how to set a custom background for the header. Basically, you have to modify the default.css file (the same one that I modified to change the colors) found in &#8220;wp-content\/themes\/arras-theme\/css\/styles\/default.css&#8221;. Here&#8217;s what you need to do:<\/p>\n<p>Find the following line:<\/p>\n<pre class=\"toolbar:1 lang:css decode:true\">#header { background: #000033; border-bottom: 5px solid #383332; padding: 0 0 15px 0;}<\/pre>\n<p>Then add the following within the header&#8217;s {} brackets<\/p>\n<pre class=\"toolbar:1 lang:css decode:true \">background-image:url('the url to your picture in http:\/\/ format');\r\n\r\nbackground-repeat:no-repeat;\r\n\r\nbackground-position:center top;<\/pre>\n<p>It should all be on one line.<\/p>\n<p><strong>Other Stuff<\/strong><\/p>\n<p>I then noticed that it was recommended to add the\u00a0<span style=\"font-family: 'Lucida Grande', Verdana, Arial, 'Bitstream Vera Sans', sans-serif; line-height: 18px; font-size: 11px; white-space: nowrap;\"><strong>WP-PageNavi<\/strong><\/span> plugin so I added it, activeted it and didn&#8217;t change any settings. And there you have it. This is what I did to hack the Arras Theme to get it like I wanted.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>First off, I have to say that I love the Arras Theme and think it&#8217;s the coolest one out there. The other day I was adding some content to my site and I hadn&#8217;t upgraded to WordPress 3.0 yet so I decided to do the upgrade. I usually like to upgrade all the plugins and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":252,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_s2mail":"yes","ngg_post_thumbnail":0,"footnotes":""},"categories":[30,74,53],"tags":[54,11,90],"class_list":["post-241","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-how-to","category-wordpress","category-wordpress-themes","tag-arras-theme","tag-wordpress","tag-wordpress-themes"],"_links":{"self":[{"href":"https:\/\/jasonmcreynolds.com\/index.php?rest_route=\/wp\/v2\/posts\/241","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jasonmcreynolds.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jasonmcreynolds.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jasonmcreynolds.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jasonmcreynolds.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=241"}],"version-history":[{"count":27,"href":"https:\/\/jasonmcreynolds.com\/index.php?rest_route=\/wp\/v2\/posts\/241\/revisions"}],"predecessor-version":[{"id":633,"href":"https:\/\/jasonmcreynolds.com\/index.php?rest_route=\/wp\/v2\/posts\/241\/revisions\/633"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/jasonmcreynolds.com\/index.php?rest_route=\/wp\/v2\/media\/252"}],"wp:attachment":[{"href":"https:\/\/jasonmcreynolds.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jasonmcreynolds.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=241"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jasonmcreynolds.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}