Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Trouble getting links to work in WP!

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #29883
    CP-SWEDEN
    Member

    Hi guys! My name is Stefan and I’m from Sweden.

    I’m using xampp for local wordpress theme development. Everything runs smooth and I’m a happy geezer most of the time. I’ve been watching Chris WP screen casts probably 100 times, bought digging into WP… Still I’m slow with the php lingo. It makes my head spin and sometimes I feel dizzy.

    Today I finally started to tweak my own theme. I’m using the Starkers theme and blueprint css. Everything is fine except one little bugger. I can’t link to the Blueprint CSS from the header.php. It worked when I linked from the style.css in the theme’s directory but not from the header. I searched on Google and found a couple of tips and to my understanding you have to include the whole path -> "/xampplite/htdocs/wordpress/wp-content/themes/"my theme"/css/screen.css". Why can’t I just use <link rel="stylesheet" href="<?php bloginfo(‘stylesheet_directory’); ?>/css/screen.css" type="text/css" />

    I solved the css problem by linking from the style.css but now I have another "link" problem. My WP site will have static pages and I’ve created a menu and links to different php files. When I move the mouse over ‘portfolio" – I see http://localhoast/portfolio and when I click it it doesn’t take me to the portfolio.php.

    Can some kind soul explain to me how to make this work. I’m confused!

    Thanks a lot! And thanks Chris for making awesome screen cast!

    #81302
    CP-SWEDEN
    Member

    Now the portfolio link works but I’m still very confused? It works when I use this url -> http://localhost/wordpress/wp-content/t … folio.php/

    Will I run into to trouble if I use this file structure when I upload the theme to my site?

    I really need help with this one… I’m kind of stressed because I need a site soon. THX!

    #81306
    Bob
    Member

    Thats because the file portfolio.php is actually located at wordpress/wp-content/themes/CP/portfolio.php, and not at localhost.
    You see, when working local like you do with XAMPP, you have to create a directory which will serve as your root folder for your website. In your case, that would be the wordpress directory. Within that directory, your WordPress site is located, just like when you would have uploaded it to your real website.

    So to answer your question whether you get in trouble if you upload the theme – yes, I believe you do. Since the links are still links to local folders instead of ‘live’ folders, you’d have to update the links to the correct ones.
    Now, I might be wrong about the following – I don’t know a whole lot about WordPress yet – but I think that if you use a certain permalink structure, you don’t have to update them. I’m not sure about that though :P
    You can find out about your permalink structure when you go to your WordPress dashboard >> Settings >> Permalinks.

    #81309
    CP-SWEDEN
    Member

    Thanks a lot Bob! Very kind of you to take the time to explain. Sounds like I’m stuck with the file structure when working with xampp. I wish there was a fix because it will suck to have to redo all the links when uploading the files to my wp site.

    I’m going to watch the screen cast ‘#73: Building a Website (3 of 3): WordPress Theme’ – think I remember that Chris explained something about the permalinks and hopefully find an cure to my illness…

    More hints, tips are welcome! Thanks again Bob!

    #81335
    CP-SWEDEN
    Member

    Seems like it’s working when I put my new php files in localhoast folder outside WordPress. Now I can use short links like <a href="portfolio.php">…

    I suspect this way of working will not give me any problems later when I go ‘live’.

    #81336
    Bob
    Member

    Yeah, it probably won’t, but if you put them outside the localhost folder, the php won’t work I think. If I’m correct, the mysql, php and perl contained in XAMPP won’t work outside the localhost directory, only inside it. Like I said, that folder is basically the root folder just like when you put your website online.

    I might be wrong though, I don’t know a whole lot about this lol. I suggest you also watch these screencasts: https://css-tricks.com/video-screencasts/86-mamp/ and https://css-tricks.com/video-screencasts … with-mamp/

    #81338
    CP-SWEDEN
    Member

    Thanks Bob! I’ll check em out right away.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘Back End’ is closed to new topics and replies.