Everything posted by nomis
-
Sublime Text and PHP
Well I replaced it in Sublime, but unfortunately it still didn't make any difference
-
Sublime Text and PHP
It's just showing up like that in the forum. In the file they're just straight quotes.
-
Sublime Text and PHP
Hi there, I’ve posted this question on the Sublime Text forum, but unfortunately nowadays that forum doesn’t seem to get a lot of traffic. And as this question is also specific to PHP and MAMP Pro, I thought I’d ask here. I’m using MAMP Pro to locally host my PHP files and I’m using Firefox Developer Edition to view them. If I type the URL of the root directory e.g : http://localhost4:8888/ … Then it will display the index in the browser and I can open the PHP files just fine. However, when I go to the side bar, right-click on a PHP file and use Open With or Open In Browser, it totally bypasses MAMP and tries to open it as if it was a normal HTML file: file:///Users/simon/Sites/LYNDA_PHP/helloworld.php Obviously this doesn’t work. Really the browser should be doing this: localhost4:8888/helloworld.php I’ve right-clicked on a sidebar file and gone to > Project > Edit Preview URLs and entered this: { "cmd": ["open", "-a", "Applications/FirefoxDeveloperEdition.app", "http://localhost4:8888/${file/\/Users\/simon\/Sites\/LYNDA_PHP\///}"] } I’ve then gone to Sublime Preferences > Package Settings > Side Bar > Settings - User and entered this: //if installed in a default location maybe this works. "default_browser": “FirefoxDeveloperEdition", //one of this list: firefox, aurora, chrome, canary, chromium, opera, safari "portable_browser": "Applications/FirefoxDeveloperEdition.app", // for example: C:/Program Files (x86)/Nightly/firefox.exe But still it’s not working. Any advice would be great. si
-
Conditional Action Hook Question
Hi again, @@Milli05 very kindly helped me resolve this PHP problem, however I’ve just realised that I have another associated problem, and I wonder it anyone can give me some advise. I’m working with a Genesis theme which uses Action Hooks to add and remove widget areas. My site divides posts into two main categories. The two blogs are completely separate from each other and are accessed by separate main menu items. Clicking on “Blog” takes you to a normal blog, and clicking on “Tutorials” takes you to a portfolio template page which leads through to completely separate tutorial posts. So far I have registered two widget areas to the ‘genesis_after_header' hook. One widget appears on the Blog Page, and the other appears on the Tutorials Page. They both contain custom menus. This means that when you're in the Blog, you can filter the blog categories, and when you’re in Tutorial you can filter the tutorial categories. The Tutorial Submenu filters by removing categories from the portfolio page. This is the code that I’m using, and it works just fine: // **************************** BLOG SUBMENU WIDGET **************************** //* rise - Register blog-submenu widget area genesis_register_sidebar( array( 'id' => 'blog-submenu', 'name' => __( 'Blog Submenu', 'epik' ), 'description' => __( 'Place submenu for Blog Page here', 'epik' ), ) ); //* rise - Hook blog-submenu widget area after header add_action( 'genesis_after_header', 'add_blog_submenu' ); function add_blog_submenu() { if (is_singular(post) && is_category('Blog') || is_category('Blog_Web') || is_category('Blog_Photos') || is_category('Blog_General') || is_page('Blog')) genesis_widget_area ('blog-submenu', array ( 'before' => '<div class="wrap"><div class="blog-submenu widget-area">', 'after' => '</div></div>', ) ); } // ***************************** TUTS SUBMENU WIDGET *************************** //* rise - Register tuts-submenu widget area genesis_register_sidebar( array( 'id' => 'tuts-submenu', 'name' => __( 'Tuts Submenu', 'epik' ), 'description' => __( 'Place submenu for Tuts Page here', 'epik' ), ) ); //* rise - Hook tuts-submenu widget area after header add_action( 'genesis_after_header', 'add_tuts_submenu' ); function add_tuts_submenu() { if (is_page('Illustrator Tutorials') || is_page('Sublime Text Tutorials') || is_page('Photoshop Tutorials') || is_page('Tutorials') || is_category('Tuts_PS') || is_category('Tuts_Ill') || is_category('Tuts_ST')) genesis_widget_area ('tuts-submenu', array ( 'before' => '<div class="wrap"><div class="tuts-submenu widget-area">', 'after' => '</div></div>', ) ); } However, the filter menus (Submenus) were not showing up on single posts. So I added (is_singular('post') to the Blog Submenu code: //* rise - Hook blog-submenu widget area after header add_action( 'genesis_after_header', 'add_blog_submenu' ); function add_blog_submenu() { if (is_singular(post) || is_category('blog_web') || is_category('blog_photos') || is_category('blog_general') || is_page('blog')) genesis_widget_area ('blog-submenu', array ( 'before' => '<div class="wrap"><div class="blog-submenu widget-area">', 'after' => '</div></div>', ) ); } This worked fine, but the blog-submenu was now also showing on the Tutorial single posts. So I added (is_singular(post) && is_category(‘blog'). My thought was that this would only add the blog-submenu to single posts that also had the Blog category attached to them. //* rise - Hook blog-submenu widget area after header add_action( 'genesis_after_header', 'add_blog_submenu' ); function add_blog_submenu() { if (is_singular(post) && is_category('blog') || is_category('blog_web') || is_category('blog_photos') || is_category('blog_general') || is_page('blog')) genesis_widget_area ('blog-submenu', array ( 'before' => '<div class="wrap"><div class="blog-submenu widget-area">', 'after' => '</div></div>', ) ); } But this made the blog-submenu disappear from ALL single posts. So I added this (is_singular(post) && !is_category('Tutorials'). My thought was that this would only add the blog-submenu to single posts that did NOT have the Tutorials category attached to them. //* rise - Hook blog-submenu widget area after header add_action( 'genesis_after_header', 'add_blog_submenu' ); function add_blog_submenu() { if (is_singular(post) && !is_category('Tutorials') || is_category('Blog_Web') || is_category('Blog_Photos') || is_category('Blog_General') || is_page('Blog')) genesis_widget_area ('blog-submenu', array ( 'before' => '<div class="wrap"><div class="blog-submenu widget-area">', 'after' => '</div></div>', ) ); } This did not remove the blog-submenu from single posts that had the Tutorials category attached. So basically, I want to add the blog-submenu widget to single posts that have the Blog category, but not the Tutorials category. Can anyone help? P.S. I've attached a copy of the functions.php file, this code is at the very end. functions.php
-
Hooking up Page and Category specific widget area
Ah yes, multiple conditions. Now I remember all those (&& || !) doohickies. I had to remove the colon at the end of the first line, and it still won’t work if I include the endif, but without those it works just fine I’m working in the functions file of a StudioPress Genesis template, and it says that I need to leave off closing delimiters at the end of files, so maybe that relates in some way to the endif problem. Anyways up, it works great in the way shown below, so thank you soooooooooo much Milli. P.S. I think I may be in love. add_action( 'genesis_after_header', 'add_tuts_submenu' ); function add_tuts_submenu() { if (is_page('220') || is_category('15') || is_category('16') || is_category('17')) genesis_widget_area ('tuts-submenu', array ( 'before' => '<div class="wrap"><div class="tuts-submenu widget-area">', 'after' => '</div></div>', ) ); }
-
Hooking up Page and Category specific widget area
Hi everyone, I’m pretty new to WordPress, StudioPress and PHP so I hope someone can help me. My site has two blog pages. One is a standard blog, and the other is for tutorials. I’ve written the PHP below to add a widget area to the standard blog page, and also to its three category pages. I’ve added a custom menu to this area so that the viewer can switch between blog categories and also go back to the standard/all category page. Here’s the thing - It works just fine. But the PHP just doesn’t look quite right to me. Shouldn’t there be an “else” statement at the end rather than an “elseif” ? When I add it, everything breaks. And do I really have to repeat all this code four times? Couldn’t I just group the page/category numbers in one block? Any help cleaning up this very amateur code would be greatly appreciated. //* rise - Register blog-submenu widget areagenesis_register_sidebar( array( 'id' => 'blog-submenu', 'name' => __( 'Blog Submenu', 'epik' ), 'description' => __( 'Place submenu for Blog Page here', 'epik' ), ) ); //* rise - Hook blog-sub-menu widget area after header add_action( 'genesis_after_header', 'add_blog_submenu' ); function add_blog_submenu() { if ( is_page('59') ) genesis_widget_area ('blog-submenu', array ( 'before' => '<div class="wrap"><div class="blog-submenu widget-area">', 'after' => '</div></div>', ) ); elseif ( is_category('11') ) genesis_widget_area ('blog-submenu', array ( 'before' => '<div class="wrap"><div class="blog-submenu widget-area">', 'after' => '</div></div>', ) ); elseif ( is_category('12') ) genesis_widget_area ('blog-submenu', array ( 'before' => '<div class="wrap"><div class="blog-submenu widget-area">', 'after' => '</div></div>', ) ); elseif ( is_category('13') ) genesis_widget_area ('blog-submenu', array ( 'before' => '<div class="wrap"><div class="blog-submenu widget-area">', 'after' => '</div></div>', ) ); }
-
Two Related Responsive Design Questions
Thanks rbrtsmith and BlueDreamer, you've really helped me clarify the situation. You see I was was originally trained as a graphic (print) designer, but you've made me realise that I can't really think in those terms anymore.
-
Two Related Responsive Design Questions
Surely screen density does matter when it comes to the resolution of photos and other non-scalable assets. I’ve seen a lot of companies update their iPad games and label them “Retina Ready”. I assumed this meant that although the screen size of the iPad had not markedly changed, the resolution of bitmap graphics had been doubled. Yes, I'm starting to realise that it's not possible to design for every individual device, but surely we have to put the break-point somewhere. At some point 4 columns must become 2, and two columns must become 1. If resolution is separate from view-port dimension, does that mean that dimension is measured using some kind of constant pixel unit rather than actual pixels (of whatever size)? When I search the web for the screen size of an iPhone 5, I'm presented with (640×1136)px. So the iPhone has 640 tiny Retina pixels across it's screen, but these aren't the pixels that we measure the screen dimensions with. How do we work out the screen dimensions of a viewport if we're only given the actual pixels? I understand that responsive design should be viewed as a continuum spanning an ever increasing variety of view-port sizes. But graphics programs don't allow for resizing so surely we need to nail it down to a few generic sizes. If you were designing a layout that had four columns for desktop - two columns for tablet (portrait) - and one column for phone, which three screen dimensions would you set up in Photoshop or Illustrator (or Sketch)?
-
Two Related Responsive Design Questions
HI, I’m trying to customise a responsive WordPress theme at the moment and I’ve come up against a couple of issues that are really making my head spin. Firstly, I’m using Adobe Illustrator to design/layout my site. Having viewed a few Lynda tutorials, I decided to create separate Illustrator artboards for individual device types (phone, tablet, laptop and desktop). As per the tutorials, I created each artboard using the pixel dimensions of a specific or generic device. The problem is that most mobile devices have higher screen resolutions than desktop computers. This means that in real terms, when looking at the Retina iPad artboard in Illustrator, it appears almost as large as the desktop artboard. Everything is out of scale. Now, while this is fine if I want to export assets directly out of Illustrator, if I want to see the actual physical size that an element will display on its target device, or compare the scale of individual layouts, this is really not great. Ideally I’d like to be able to to hit 100% in Illustrator and see all of the devices/artboards displayed on screen at their actual physical dimensions. (I can always scale up any vector assets later). Is this possible? Is there’s a way that I can use the pixel dimensions and the resolution of a device to calculate the actual physical dimensions? Secondly, this theme has a breakpoint of 767px, below which it rearranges it’s layout (single column) for mobile phones. Now, when previewing my design using Responsive Design View in FireFox or Responsive Web Design Tester in Chrome, I can enter the pixel dimensions for, say, an iPhone 5 (640×1136), and it will display a preview in my browser. Because my iMac has a much lower resolution than my iPhone, the preview displays much larger than an actual physical iPhone screen. Not very useful. Because the pixel dimension are substantially larger than the Media Query that targets phones, the phone layout is not triggered. Even less useful. However, when I view the site on my actual iPhone, it displays perfectly. Question: Am I going mad?
-
Code Colour
It;s not the number of colours that's a problem, it;s that fact that they can only be assigned to eight predefined elements, and they are not necessarily the eight elements that I'd choose. To illustrate:
-
Code Colour
To me, yes. After all, if it wasn't considered important, why would the TextMate developers have included this functionality? I accept that it may not be important to you. si
-
Code Colour
Hi Guys, I'm pretty new to coding, and up until now I've been using TextMate as my code editor. One of the things I like about TextMate is that it gives me very precise control over the colour of the code. Fro example, I can specify a colour just for hex numbers. Now that's all well and good, but I recently started using Dreamweaver and although there is some control over the colour of individual code elements, it seems very basic (e.g. in CSS it's limited to eight very broad areas - via Prefs > Code Coloring). Am I missing something, surely there must be a way to get more precise control over code colour? si
-
CSS Videos
Hi there, As can clearly be seen from my earlier "IE7 Broke my Site" post, I've got myself into a bit of a CSS/Layout pickle. Now the prospect of wading through the "Big Book of CSS" seems about as much fun as garotting myself with my own scrotum (Not much fun) That said, I was wondering if anyone could recommend any good video tutorials (cost is not a problem) that cover CSS positioning and layout. And maybe one that covers slicing an image in PS and then converting it to html/css. Your help would be much appreciated on this, si
-
reset.css
Hi Guys, I'm fairly new to css, but I've recently learned about reset.css files. On the face of it it seems like common sense to me. I mean: 1. You get a clean slate to start designing from. 2. You get beter cross-browser compatibility. Yet, from what I've read, many web designers don't seem to think it's a good idea to reset ccs. Can anyone tell me why this is please? Cheers, si
-
IE7 Broke My Site
Thanks guys, I guess it's back to the drawing board then. Although bare in mind that it is my first ever effort. si
-
IE7 Broke My Site
Cheers for the reply, but I'm not using any CSS3, rounded boxes were made using two small images on each corner, each in a separate div. I really can' see why this dosen't work in IE7, it's all just XHTML and CSS2. If anyone can tell me how to add EI specific code I'd be eternally grateful. si
-
IE7 Broke My Site
Hi There, I've recently been learning XHTML/CSS (hand coding) and I thought I'd start to put a simple site together - Not a genuine site, but just an exercise. I used one of the free hosts to get it online. Here is the URL: My link The problem is, it works just fine on Chrome, Firefox and Safari (both on Win and Mac), but a few things break when it's viewed on IE7 (and one or two on IE8) Dose anyone please have any ideas how I can fix these? It should look like this: By nomos66 at 2011-06-09 But it looks like this: By nomos66 at 2011-06-09
-
Load Time
Load Speed by nomis on Wed Jun 08, 2011 12:15 pm Thanks to advice given in a n earlier post I've now got my first ever test page online (using a free host) The problem is I'm not sure if it's taking too long to load - I can see the divs loading individually, even the empty ones. (maybe I'm just being paranoid) Assuming that it is taking too long, is that likely to be because the free host has a slow connection, or should I reduce the quality of my graphics? This is the URL: http://robotica.99k.org/ si nomis Posts: 7 Joined: Tue May 17, 2011 1:36 pm
-
Getting it Online
Thanks Matheh, I had some problems uploading to ###### but I found a site called Zymic and that seems to have worked.
-
Getting it Online
Hi again, I'm pretty new to HTML and have been using books a videos for a few months now (I wanted a good grounding in hand coding before moving on to DW) I've put a few pages together (more as an exercise than anything else) and I'm wondering if there's a free and easy way to get them online. I really just want to see if they work properly and it would be a good way to share ideas with the other students on my HTML course. Thanks in advance, si
- Mac - PC issue
-
Mac - PC issue
Cheers Guys, I does sound like good advice for me maybe to get hold of a cheap PC just to test things on. si
-
Mac - PC issue
Hi Guys, I've been doing all my coding on my Mac (27" iMac) and my home page looks nice and sharp and about the right size (in this case: 800 x 100px) But I brought it to my HTML class the other day and loaded it onto one of the PCs and was pretty shocked. Firstly it was much bigger (not just a little) it filled the whole screen, and secondly there was a real lack of sharpness (the graphic images looked as if they had been scaled up in PS) Does anyone have any ideas what's happening here and how to avoid it. Thanks in advance for your help, simon
-
Rollover Question
Thank you both very much, I used a sprite for the buttons and it solved both of my problems. si
-
Rollover Question
Hi Guys, I'm just learning HTML/CSS and I'm just building a test site (on my computer) to try some ideas out, However, I'm having a few problems with my rollover butons and I was wondering if anyone could please help. When I initially mouse over the buttons there is a distinct delay and the rollover (a:hover) images jump/pop awkwardly as they appear. The delay is quite small but the effect is horrible. It's as if the browser is searching for the hover images before it can load them. I was wondering if the was a way to "pre load" the hover images, and if you thought that this would solve the problem? At the moment my header buttons are just linked to external pages (google etc.). If I click on a button (going to that page) and then back-arrow on the browser, the hover image remains visible. It is only visible while the mouse is over the browser back button, and as soon as the pointer is moved to over the viewport area the button returns to its off state. Any ideas? si