WordPress.org

Ready to get started?Download WordPress

Forums

Help with using WP as a CMS (26 posts)

  1. foxden vixen
    Member
    Posted 2 years ago #

    I watched a video on youtube about using WP as a CMS. My client doesn't want his site to be a blog but just a normal website that he can add content to. When I try to follow the video there is one major problem...I create a new page but on the right side there is no way to choose default template or anything else. I have my own design that I created in HTML/CSS. I feel that I am missing templates that come with other themes that are required. Please take a look at the video http://www.youtube.com/watch?v=1o2XcHqQbRY and let me know how this person is doing this. My site is at http://foxdenwebsolutions.com/test. There will be 6 pages total. Thanks.

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    I create a new page but on the right side there is no way to choose default template or anything else

    this means that you don't have any page template in your theme;

    start by creating one or many - http://codex.wordpress.org/Pages#Page_Templates

  3. foxden vixen
    Member
    Posted 2 years ago #

    I did use this code at the top of all my HTML pages as in the video - <?php /* Template Name: Home */ ?>, <?php /* Template Name: Noise 101 */ ?>, etc. Is this what you are talking about? Or do I need to create something else that is a page.php?

  4. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    at the top of all my HTML pages

    does this mean your 'templates' have a .html extension?

    a page template will need to be a .php file.

  5. foxden vixen
    Member
    Posted 2 years ago #

    I'm sorry....I saved all the HTML pages as PHP pages.

  6. foxden vixen
    Member
    Posted 2 years ago #

    I removed all the .php pages that I created and started over. In the themes folder before adding the pages, there is header,php, index.php, style.css, functions.php, sidebar.php, and footer.php. I took my index.html page added the code - <?php /* Template Name: Home */ ?> - and saved it as home.php. Now I can choose either default template or home page template. I chose Home and pasted my HTML in the editor for the page under the HTML tab. There is absolutely no style to at all. I changed to default template and it shows my styles. I am so confused. I have read through the Codex on creating pages and it is not making sense to me. All pages will be static but editable by the client. How do I go about doing this? Also how do I get MY main nav and footer nav to work?

  7. foxden vixen
    Member
    Posted 2 years ago #

    I just don't get how to do this. I know HTML/CSS but this is beyond me! Please help me learn how to do this!

  8. Pioneer Valley Web Design
    Member
    Posted 2 years ago #

    Do not use home.php as a template name (certain names are reserved) ,use a unique name (mynewpage.php is OK)...that said, also note:

    Try switching to the default twentyeleven theme, deactivating all plugins, and then attempting again to associate a page or post with a custom template...many themes either block or do not work with such. If you can get it to work with default theme, activate plugins one at a time to test each (review if compatible with your version of WP), but not a caching plugin yet (activate when all site testing is complete)...

  9. foxden vixen
    Member
    Posted 2 years ago #

    I followed the instructions from SwansonPhotos and this did not work. It worked with another theme installed. These are the php pages I have in my custom theme that was created from the HTML/CSS design I created for my client - header.php, index.php, sidebar.php, footer.php, functions.php (to register custom sidebars), and the new homepage.php page. I took what was on the index.php page and placed it on the homepage.php page with the PHP code that makes it a template. When I try to add a page called Home there is still no drop down in the page attributes section on the right. I don't have any plugins installed. Both sidebars are widgetized so I don't know if that is causing the problem. Back to step one.....how to I turn WP into a CMS where I can control the content of 6 pages of HTML code. BTW, there are 3 CSS pages associated with the site for a responsive site and a CSS page for the image slider at the top. The home page will be 3 columns with left and right sidebars and the other pages will be 2 column with only the right sidebar.

    What I have noticed is that I cannot get away with removing the index.php page. It has to stay. Could I possibly use that without the Loop to have it be the home page and then add pages for the 5 pages in the site? I am sorry that this is confusing me so much. I just can't wrap my head around this. Creating a static website is what I am used to doing. However, I DO want to learn.

  10. dragonsjaw
    Member
    Posted 2 years ago #

    You actually need a page.php to start with to make your custom template, like for a static home page or your about us page.
    And to use pages instead of posts for content.
    If this is a theme you downloaded and then tweaked, go make sure there wasn't a page.php in the theme download.

  11. dragonsjaw
    Member
    Posted 2 years ago #

    You can always take a look at page.php in twentyten or twentyeleven, they are different, and use that as a starting point.

  12. foxden vixen
    Member
    Posted 2 years ago #

    This is actually my own theme I created from the HTML site I created. No there is no page.php in it. So do I leave the index.php page alone as I built it? What do I add to the page.php? I am looking at the TwentyTen page.php and it has this code-

    get_header(); ?>
    <div id="container">
    <div id="content" role="main">
    <?php
    /* Run the loop to output the page.
    * If you want to overload this in a child theme then include a file
    * called loop-page.php and that will be used instead.
    */
    get_template_part( 'loop', 'page' );
    ?>
    </div><!-- #content -->
    </div><!-- #container -->
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Would I just paste in my container code? -
    <div id="contentWrapper">
    <div id="content">
    <h2>Recent Posts</h2>

    Not sure what get_template_part is?

    For the other pages that only have the right sidebar how do I go about creating those if it has to read off of the index.php which has both sidebars?

    I am thinking static site and the idea of having serveral different pages put together to create ONE page is not what I am used to. It would be a lot easier if WP actually worked that way...just upload my static pages and then the client can do what he wants.

  13. Have you read (and researched) the WordPress Codex?

    It sounds like you are asking developer-related questions without having a proper understand of how the WordPress framework functions (which can be extremely frustrating to you).

    WordPress is unlike static HTML sites. It is possible to replicate a static HTML site, but it will take some modifications (as you are finding out).

    In order to understand how these modifications interact with WordPress, it's important to understand the framework.

    Here is a great page in the codex to get started understanding templates, and how they work:
    http://codex.wordpress.org/Stepping_Into_Templates

  14. dragonsjaw
    Member
    Posted 2 years ago #

    Page.php from twenty ten will give you right sidebars.

    The only way to know if this will work for you is to upload page.php to your theme folder.
    Then create a custom page from it, (just copy and paste into new template
    page)
    Then see if you can actually pull up the template in the editor section.
    The index.php seems to be working nicely. If you can get a page template to work, you can use that as a static front page and then use the (blog posts) index page as news or something like that.

    Seeing's how you are new to WP and starting with a custom theme, you have quite a learning curve ahead.

  15. foxden vixen
    Member
    Posted 2 years ago #

    I am reading the Codex page that Josh pointed out. I understand that the header, footer, maybe sidebar pages are put together with the index page, which seems to be the main part. Now if I want other pages to have a different look, I would create a different named something like twocolpage.php to hold that different look?

  16. dragonsjaw
    Member
    Posted 2 years ago #

    I have never made a theme from scratch, almost.. but mostly using a theme then making a child and customizing from there.

    But yes you can make page templates to acheive most any layout look you want.

  17. foxden vixen
    Member
    Posted 2 years ago #

    Ok so let me see if I get this. The home page of the site will be driven off of the homepage.php and the rest of the site will be driven off of twocolpage.php. I would not have to make 6 page templates because the two templates will be the foundation of the "pages" that I create in the admin console. But how does the index.php page work? I know I have to leave it in but I don't want The Loop happening on the home page unless it can pull info from the different pages....not posts.

  18. Pioneer Valley Web Design
    Member
    Posted 2 years ago #

    I think this question was answered above - review the template hierarchy and at some point invoke the loop for the 'blog'.

    index.php 'could' just be a login, a piece of text, or a simple html page wrapped in php.

  19. foxden vixen
    Member
    Posted 2 years ago #

    I have added the home page and it works. Now I am having trouble with the next page - Noise 101. I have set up a new two-column-page template page. I can add the page Noise 101 and have it use that template. I have added content to the page, but when I view the page, it is pulling the left sidebar and it shouldn't. On the template I only have <?php get_sidebar(right); ?> but for some reason it is pulling the left one as well.

    Here is the code for the two-column-page template

    http://pastebin.com/N6gjycS9

  20. foxden vixen
    Member
    Posted 2 years ago #

    To see how it is supposed to look go to http://foxdenwebsolutions.com/CACNR/index.html and click on the links for the other pages. This is the HTML version of the site.

  21. foxden vixen
    Member
    Posted 2 years ago #

    Also I have the exact same code locally for testing that I do on my business page testing area but locally it says that the Noise 101 page cannot be found. Weird!

  22. foxden vixen
    Member
    Posted 2 years ago #

    I see where it is....it's pulling both sidebars from sidebar page. However I have tried to split it up into 2 separate pages and I get errors. That is why I combined the 2 sidebars into one page.
    Here is the sidebar code -

    <div id="sideBarWrapper">
    <div id="sidebar_left">
    <?php
    if(!dynamic_sidebar('sidebar_left')) {
    /**
    * The primary sidebar widget area. Manage the widgets from: wp-admin -> Appearance -> Widgets
    */
    $theme->hook('sidebar_left');
    }
    ?>
    <!-- #sidebar_left --></div>
    <div id="sidebar_right">
    <?php
    if(!dynamic_sidebar('sidebar_right')) {
    /**
    * The secondary sidebar widget area. Manage the widgets from: wp-admin -> Appearance -> Widgets
    */
    $theme->hook('sidebar_right');
    }
    ?>
    <!-- #sidebar_right --></div>
    <!-- #sideBarWrapper --></div>

    Any help in successfully splitting this up in two separate pages (i.e. sidebar_left and sidebar_right) will be greatly appreciated.

  23. foxden vixen
    Member
    Posted 2 years ago #

    OMG I got it to work. Found a site that explained sidebars and using <?php include(TEMPLATEPATH."/sidebar_left.php");?> or <?php include(TEMPLATEPATH."/sidebar_right.php");?>

    I did create 2 pages for the two dynamic sidebars and this works now.

    Next - getting my menus to go to the pages correctly. I am used to HTML href code for that. Any ideas on how this works? I will search but any help would be greatly appreciated.

    BTW I still can't view the Noise 101 page locally.

  24. foxden vixen
    Member
    Posted 2 years ago #

    Found out the problem with seeing the new page locally. Seems that I had to change Apache Modules - Rewrite Modules. Weird.

  25. foxden vixen
    Member
    Posted 2 years ago #

    I still need help with the menus. If you look at the site you will see my menu in the header and in the footer. The divs for these are mainMenu and footer. I am not sure I can use the menus section in WP for this or can I? I have styling for the menus in my style.css page that needs to work how the HTML site works. I have read the Coden on menus but I am confused by it. It seems that this is for adding menus that don't already exist in the code.

  26. foxden vixen
    Member
    Posted 2 years ago #

    Menus are done. I was able to use the menu feature in WP and it worked perfectly.

Topic Closed

This topic has been closed to new replies.

About this Topic