[SOLVED] how to create a page template?
Hi,
I am new to Wordpress and I am using Atahualpa. I try to use WP more like a CMS. So I have a lot of pages. In the documentary of WP it is written that I can use templates for pages to insert posts of a specific category in my pages. The page.php should be the default template. And I just need to create a new something.php for each page which should have a unique template. But there is no page.php in the atahulapa-folder. When I copy one from the default-WP-theme and name it like template1.php, it doesn't show up in the template-dropdown-list. How does Atahualpa handle templates? Does it at all? Or is there any other way to bring complete articles to a page? Greetings, Drongo |
With ATA all the "templates" are created from the same .php files. It won't matter whether you're creating a post, a page, an archive, etc. If you want to create a bunch of pages you just need to go to the Page section of your admin and click "add new" to get another blank content screen for a new page.
With ATA, you only need to create a page templates if you want to have a different page formats or styles from the one you are primarily using. Say for instance if you want to create a blue colored background for all your posts on peas and a green colored background for posts on blueberries... You'd make a "blue" template and a "green" template. And those would appear in the dropdown. If you don't need pages that look "different" you're all set with ATA. You just need to add a new post or a new page. It's automatic! Rashell |
Do you have an example of what you are trying to accomplish drongo? There is probably an easier way to go than creating page templates.
|
Hi,
I know how to create different pages. But I dont know how to add articles of the blog to them. I am trying the plugin WP-RSSImport to add a feed of my categories to single pages, but it is not working very good. For example, I have a page for press-articles about our culture-centre (its a german page): http://www.kubiz-wallenberg.de/wordpress/?page_id=210 Here are only articles from this category: http://www.kubiz-wallenberg.de/wordpress/?cat=12 And on the main page only special articles should show up: http://www.kubiz-wallenberg.de/wordpress/ from this category: http://www.kubiz-wallenberg.de/wordpress/?cat=1 The plug-in is not working good. Normaly it should add the articles with full html (images and stuff), not only the preview. I thougt this can be accomplished more easily using templates. Greetings, Drongo |
|
nope, these are only for the front-page. But I want to have at the front page articles of category One, on another page articles of category Two and so on.
|
Ahhhh! I think I get it. You're trying to stylize your category pages with more information than what's coming up automatically.
If you need them images attached to your excerpts in thumbnail view. I've been able to add images using "Thumbnails for Excerpts". But that plugin had a conflict with another when I updated so I used "Get the Image". If you really want to create a new page template you have to grab & combine code from 3 sources in ATA. The... header.php index.php footer.php You can combine the 3 give them a new template title (change the "LP" in the code below to whatever name you want to give it) and you'll see a new drop down box with that title included. I created a new template that is exactly the same as the original except the header.php has a dynamic header rather than the original ATA header. Because nothing changed in the footer I left it as the original index.php was set up. From what I understood you'd have to combine the header.php & index.php to form a new template since both have important elements of the code, which makes the page display. I may be wrong... As I mentioned the code below changes the header of the page giving it a Dynamic Header so if you download that plugin you're good to go. Otherwise you want to change the code between PHP Code:
PHP Code:
|
How about Just One Category?
|
You wrote:
Quote:
So rather than having 2 pages they'd combine as one? |
okay, when I combine these three files I got a new template. this is working. I have to delete header, footer and sidebar in the template, because WP opens the page with the template only _within_ the main part, so I got two headers, two footers and two sidebars. I will try to add the part for the blog-articles there.
Sorry for my bad english. Here again what I want: I have a lot of pages. Each page descripes for example one project of our centre. Images, Texts, contact Infos and so on. And at the end of some pages should be the last articles belonging to the project, with full text and images, not only a preview. Each project gets its own category in the blog, so I can filter them. There are also pages with press articles (I showed you) or the main page with articles about the centre. Greetings, Drongo |
Ugghh that 2 header thing may have been my fault. I gave you poopy directions.
All you'd have to do is copy and paste the code above to a blank .php file that you can name whatever. For instance mine is lp.php Your English is great! I'm using my site in a totally different way so I'm just trying to envision what you're wanting to do against the plugins I know are out there. There's just so many different things you can do it's hard to get your mind around all of them. Are you trying to segment your blog, like a newspaper would? You have the Sports Section all sports related. The Lifestyle section, the Comics, the Classifieds. Each has a separate section. None overlap? |
okay, in the template under
Code:
<?php bfa_center_content($bfa_ata['center_content_bottom']); ?> Code:
<?php query_posts('cat=12'); //gets all posts But only the short version. When I write cat=-0, as it was written in the documentary of this code, it gives me all articles, no matter which category and shows me the complete articles with images and so on. strange... but one step further. |
Quote:
|
okay, so now I'm stepping into "I really have no idea what I'm talking about" so I'll just watch and learn from here on out.
The only thing I can think of is somehow changing something from "get the excerpt" to "get the post" but what I have no idea. So sorry. |
okay, I found an option in the atahualpa-settings to turn of the shortage in category-pages (which is used, when I filter by category). now I have full posts.
I am using now: Code:
<?php Every page shows me the same 3 posts at the bottom: http://www.kubiz-wallenberg.de/wordpress/?page_id=2 Is it possible to use a variable for the query? When I create a page, I can add variables to it. Maybe I can add a variable like "articles" and here in the index.php I ask if there is this variable at the page and if, then it uses the code from above, but implement the variable in the query. The variable should have the query, like "'cat=13&showposts=3&paged='.$paged". |
WORKING :-)
By default it is not possible to use the custom values outside the loop in a template. You can ask for them using the_meta(), but thats only a list of all values. With the plugin "Get Custom Field Values" you are able to get specific custom fields, for example with c2c_get_custom('fieldname'). I added to one page the custom field "articles" with the value "cat=13", if I want to have all articles of this cat at the end of the page. Then I added to my index.php after <?php bfa_center_content($bfa_ata['center_content_bottom']); ?>: Code:
<?php If this is not empty, it will add three posts of the category specified in the custom field to the page. Thats it. Thanks for the tipps, Drongo |
All times are GMT -6. The time now is 09:11 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.