2013-12-23, 22:00:08
(2013-12-23, 14:13:55)Craziwolf Wrote: I have been racking my brains trying to figure it out but am coming up short. At the moment I am using news manager but would like to display static content above it. So far I have been un successful and would like some suggestions on how I might achieve this?
I think I can tell you how to
Let's say you have page in GS called 'News'. In GS, you can set a template the page will use.
- So, create an extra template just for this page. You can just copy the global template, file template.php which is in your /theme/ThemeName/ folder).
- Call it like "templateNews.php" or whatever - it doesn't matter at all.
- Set the templateNews.php as the template of the GS page 'News' (go to the administration, open the News page and in its preferences, there, you can set the template for the page).
- Now you have a place where you can put static content above the content.
- Open the templateNews.php and put your static content above
There you goCode:<?php get_page_content(); ?>
One thing to make it easier for you is that instead of creating a brand new template, you can just add the content to your global template (template.php), but you have to wrap the static content between
Code:
<?php if (return_page_slug()=='news') { ?> and <?php } ?>
This is what you have to do if you use the latest stable version. However, there is a trouble about it - it will be shown not only above the list of the posts (main news page, 'News'), but also above each post when you click it. If you want to to fix this, I think you have to use latest beta (a few posts above). I use it on a live site, see my signature, you don't have to worry.
For the beta, solution is much easier as there are special functions that can make your life easier:
- You don't have to create any special template. (Well, you don't have to in the previous solution either, but it's even more elegant now because of some nice functions)
- You can set what static content will be above the list of the posts and what above the posts itself when you open them
- So, again, as in the previous case, open your template that the page with your posts uses. Usually template.php in /theme/YourThemeName/, but it can be a different according to your edits.
- The static content you want to show above the complete list of posts ONLY (main news page), wrap between . This static content won't be shown above any of the posts when you open them.Code:
<?php if (nm_is_main()) { ?> and <?php } ?>
- The static content you want to show above each of your posts, wrap between Code:
<?php if (nm_is_single()) { ?> and <?php } ?>
Don't forget to place it properly in the code. In most cases, it should be directly above the <?php get_page_content(); ?> tag.
In case you're using beta and you want to show the same static content above both the main news page and all the posts, you can use the solution with the "slug condition", or just join these two functions (nm_is_single(), nm_is_main()) with logical OR.
Hope this is the answer you were looking for
Tomáš Janeček - Multilingual personal website powered by GetSimple
» The little I did for GetSimple
» The little I did for GetSimple