• I am new to WP and have a client that needs his site that I created in HTML and CSS converted to WP. I have watched countless videos and have many books but am really stuck on how to get this done correctly.

    The original site can be viewed at https://foxdenwebsolutions.com/CACNR/index.html

    So far I have the following pages – header.php, index.php, sidebar_left.php, sidebar_right.php, footer.php functions.php.

    header.php

    [Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

    My css is broken down into 3 separate pages for responsive design and I have flexslider at the top of the page so have the css for that.

    As you can see, this is a very unique design and right now I am having problems getting the sidebars to show. Please can someone show me the correct code in order to get these to work? The left sidebar will be for News items that the client wants to add and the right sidebar will be for the search, links that the client wants to add, a calendar, RSS feed, and whatever else he may want.

Viewing 15 replies - 1 through 15 (of 53 total)
  • Thread Starter foxden vixen

    (@foxden-vixen)

    Sorry I did not realize I could not have several lines of code.
    Here is the code on pastebin.com
    header.php
    https://pastebin.com/BfVays1w
    index.php
    https://pastebin.com/7A5DVQUD
    sidebar_left.php
    https://pastebin.com/0UWf9xhw
    sidebar_right.php
    https://pastebin.com/3FC7P7Nn
    footer.php
    https://pastebin.com/Z6Z3RVyk

    Please someone with knowledge of converting HTML to WP help me configure this correctly.
    Thanks.

    I’m not too sure, as i’m only learning myself, but, have you included the WordPress stylesheet correctly?

    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />

    You seem to have included the URL to the WP stylesheet, but you haven’t defined it.

    It should read;

    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>/STYLE.CSS" type="text/css" media="screen" />

    Where “STYLE.CSS” is the name of your wordpress CSS file (usually style.css)

    Thread Starter foxden vixen

    (@foxden-vixen)

    OMG I see what you are talking about. I will test this when I get home. I forgot to add that and the main stylesheet has all the sidebar styling on it. The other stylesheets are for the responsive layout (i.e. bigScreen and smallScreen). I am glad another pair of eyes caught this.

    I thought they might be for the responsive side of things ?? It’ll more than likely be style.css unless you’re using a theme that’s pretty much changed everything as a base!

    Hope it works out for you! ??

    Thread Starter foxden vixen

    (@foxden-vixen)

    I am not creating a child theme….that is what is throwing me with the PHP code that I have use.

    No, perhaps I worded that wrongly! lol! I mean ‘style.css’ is the default name for the WordPress stylesheet. Some themes modify everything so much, including the name of the stylesheet, so it may not be ‘style.css’ it may be something else. If you’re doing it off a default theme (fresh install of WordPress) it’ll be style.css you need to add to the end of the link rel as I showed you above.

    I reckon if you change your link rel as above it should work out for you.

    ??

    Thread Starter foxden vixen

    (@foxden-vixen)

    I came home and changed the code but that did not work. I did have the code in there correctly according to all the online tutorials and the books I have read.

    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen,projection,tv" />
    	<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/bigScreen.css" type="text/css" media="screen and (min-width:66em)"/>
    	<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/smallScreen.css" type="text/css" media="screen and (max-width:751px)"/>
        <link rel="stylesheet" href="wp-content/themes/cacnr/css/flexslider.css" type="text/css">

    The main stylesheet is called style.css so the first link is correct. In order to call all the other css pages I have to use template_url. The only that did not work was the flexslide.css page. I tried using the same syntax and it didn’t work. I have all the stylesheets in the root with the php pages.

    I guess back to the drawing board! ??

    First off, according to the pastebin code your header.php file is missing the closing </head> tag, might be related to your issue, might not.

    Secondly, when you relative link a file as you are here:<link rel="stylesheet" href="wp-content/themes/cacnr/css/flexslider.css" type="text/css"> it will look for the file relative to the directory you are at.. for example, a file linked without an opening trailing slash (href=”file.css”) it will look for that file relative to the URL you are on (www.example.com/im-in-this-folder/file.css). If the file doesn’t exist there, it will 404.

    in the case of “wp-content/themes/cacnr/css/flexslider.css”, it will only find the CSS file on the root of the domain “example.com/wp-content/themes/cacnr/css/flexslider.css” but will 404 when you go elsewhere “example.com/subpage/wp-content/themes/cacnr/css/flexslider.css” <- not found.

    You are right to use the template_url function to get the template URL, which appears to be, in your case, “/wp-content/themes/cacnr”. That is the url the function will echo, so if you have a folder inside your theme folder called “css” with a file inside it called flexslider.css, then you would write it as follows:

    href="<?php bloginfo('template_url'); ?>/css/flexslider.css"

    you can use this to access any folder in your theme.. lets say you have an images folder with a picture.jpg inside:

    <img src="<?php bloginfo('template_url'); ?>/images/picture.jpg" />

    I highly recommend installing the Firebug browser plugin if you haven’t. It will save you tonnes of time figuring out hair-pulling problems!

    Thread Starter foxden vixen

    (@foxden-vixen)

    Thanks Space. I did fix the </head> problem. I changed the code for flexslider.css and it is calling it properly now.

    My next problem is getting the sidebars to work. Can you see what the problem could be with the sidebars? You can see images of what I have at https://foxdenwebsolutions.com/CACNR/images/top.jpg and https://foxdenwebsolutions.com/CACNR/images/bottom.jpg. I want my own stuff in the sidebars and don’t want pages, archives, categories, and meta but somehow it is picking those items up. I am working from scratch with my own theme so I don’t know how they are being populated.

    I do have Firebug on FF and Google Chrome’s version of Firebug, whatever it is called.

    Thread Starter foxden vixen

    (@foxden-vixen)

    Oh this is too weird. Looking at the code in FF using Firebug, it seems that my “head” info is under “body”! Now when looking at the different php pages, the head info is where it belongs! I did fix the closing </head> tag and saved so I don’t get it.

    The sidebar things you are seeing are the default sidebar.php widgets. Depending on your theme, you should be able to add new widgets under Appearance -> Widgets in the wordpress administration.

    In a theme, a sidebar is usually called with the get_sidebar() function (or the dynamic sidebar if statement). In the code you have in the pastebin, it looks like you’re trying to call a “sidebar left” and “sidebar right”, but I can’t see if you’ve registered your sidebars in the functions.php file, or if you created a sidebar-left.php and sidebar-right.php file.

    As for the head tag.. I’d likely need to see your current source to figure that one out.

    Thread Starter foxden vixen

    (@foxden-vixen)

    I do have sidebar_left and sidebar_right created. I have a functions.php page registering 2 sidebars. How do I take out the default widgets? I don’t want them in there.

    Also I am doing this locally as I have no idea how to add a new instant of WP to my existing business site, which only runs WP with a blog page that I set up.

    I use godaddy.com and if you know how I can add another instance of WP or if I can add another db to my existing WP set up without screwing up my business site, then please share! That way you can see what is going on.

    Thread Starter foxden vixen

    (@foxden-vixen)

    I am going crazy. I still can’t get MY sidebars to show. I have tried everything I can think of. The default content of the sidebar shows up and I am NOT using any other theme but the one I created in HTML/CSS. I do look at other themes to see how they are constructed and take snippets for such things as The Loop, get header, get sidebar, get footer. The default sidebar info is picking up my CSS that I have for my sidebars as in the h2 styling, but none of MY sidebar info is showing.

    Here is the code as it is now
    header.php
    https://pastebin.com/mDerVw8K
    index.php
    https://pastebin.com/67nV6dc1
    sidebar_left.php
    https://pastebin.com/c1W1zJAr
    sidebar_right.php
    https://pastebin.com/rP07iC7H
    footer.php
    https://pastebin.com/q9xbTYaR
    style.css
    https://pastebin.com/V3i014ix

    Once I get this index page working I need to figure out how to remove the sidebar_left for the other pages. Hopefully someone can look at my code and figure out what is going on.
    The actual HTML site is at https://foxdenwebsolutions.com/CACNR/index.html so you know what it should look like.
    The image showing what WP is doing is located at https://foxdenwebsolutions.com/CACNR/images/bottom.jpg. The left sidebar will hold news that the client adds and the right sidebar will hold the search feature, his outside links, a calendar, RSS feed, and whatever else he decides to put there.

    Someone please help with this as I am ready to tell the client that either he gets an HTML site or he needs to find someone else to do this as I can’t figure out what is supposed to be so simple!

    Thread Starter foxden vixen

    (@foxden-vixen)

    Well I have deleted WP from my computer, re-installed, and am trying to decide if I want to use an existing template and build a child theme from that.

    Thread Starter foxden vixen

    (@foxden-vixen)

    I have downloaded several 3 column left and right sidebar themes and they all have the index.php page calling the first sidebar, then the content, then the second sidebar and then the footer. Guess no one here could see the problem I was having. I have to re-code everything as I deleted what I did so far but now I know how to have 2 sidebars.

Viewing 15 replies - 1 through 15 (of 53 total)
  • The topic ‘HTML to WP having problems’ is closed to new replies.