January 1, 201313 yr Hi guys, I'm working on my website and trying to use WP with it. I'm not making a blog, but more a site with single pages I already have the header, menu and footer working like it is suppose to be in WP I already made the pages in WP but now I need to get WP to display the pages, because the menu already links to the right page, but I dont know the code of WP that displays the page with the right ID I tried to use function get_pages() but that doesn't work... Cheers
January 1, 201313 yr It depends on what you want an each page. You could make a custom loop for each page so that it is outputted accordingly. What information do you want on each page? Personally, I like to use this code to make a custom page: <?php /* Template Name: NAME OF TEMPLATE PAGE HERE */ ?> Save the file as about.php (if it was to be an about page) and then you can make it a page template in the wordpress admin. I like this way because it means i can organise the code better and have the code i want on the right page with out lots of if and else's everywhere.
January 2, 201313 yr Author That is a great idea to do that So I need to make a page that contains something like this (see code) if I want to make an about page And then link that to the menu? <?php get_header(); ?> <div class="band chief"> <div class="container"> <div class="sixteen columns content"> <?php get_about(); ?> </div><!--end sixteen--> </div><!--end container--> </div><!--end band--> <?php get_footer(); ?> Thanks Edited January 2, 201313 yr by Row
January 2, 201313 yr Author I got it working But now I still have 1 challenge I need to make the content editable, any ideas for that? Cheers
January 2, 201313 yr What content do you have on the page? Are you outputing it using a custom loop? This may be a place to start. You can create multiple loops and categories for your content to go in. From that you can have a loop for each category ( cats and dogs for example) and you can tell the loop only to display posts from the cat category or dog for example. Another way, and it may be easier, depending on how much editiing will actually be needed - You could create the pages in static html, add all the classes and ids then style then as needed. Say it was the about me page. You would then copy all of your static code into the corresponding page template in the wordpress admin page tab. On the section where you write posts, you can add html - paste your code in there. You can then switch it back to the normal view and be able to edit all of the content inside the html tags. I think this is possible - perhaps someone else could correct me or offer a simpler option?
January 2, 201313 yr Author Well I have just some normal content text and I put that into the pages I need in Wordpress, so I have like 6 pages with information I only need to display the content of the page when one of the items in the menu is clicked, so the content of the page need to be linked to the ID of the page Hope that helps
January 3, 201313 yr If the content is simply a title and a block of text , i.e. typical wordpress, then you can create 6 categories and then use the is_category function to output the correct content. I doubt it is that simple though. You can use text box widgets to output other areas if you have different text areas on the page. It all depends on the layout you want to achieve hence the custom/multiple loops to output the content. the basic wordpress loop will output a title with the_title function and the content of the page with the_content funciton. the_content function will probably be inside <p> tags so its difficult to have links etc inside that with out altering the code. Hence the reason i mentioned pasting all of the content for the particular page in the corresponding page template with the page tab in the admin. If you do it that way you can paste all your needed content, then switch back to the visual editor with the button and your content will be there but you wont have to worry about the html.
Create an account or sign in to comment