aw.be Posted October 17, 2012 Share Posted October 17, 2012 I know this is relatively easy php stuff, but I can't get it right. This is what I have for my title tag, right from the default install: <title><?php echo $page->get('headline|title'); ?></title> But I want to append the site name to the headline with a vertical line in between. What's the best way to do that? Sorry - I'm still fumbling through learning php and was unable to find a snippet for this that wasn't specific to Wordpress. Aaron Link to comment Share on other sites More sharing options...
Pete Posted October 17, 2012 Share Posted October 17, 2012 Erm... No PHP required - just add " | Your Site Name" before the closing </title> tag and you're done. I think that's what you meant anyway? Link to comment Share on other sites More sharing options...
aw.be Posted October 17, 2012 Author Share Posted October 17, 2012 My goodness, I'm a dumbass Thanks Pete. I hadn't thought about adding the site name outside the php closing tag. Sometimes I like to make things complicated. Link to comment Share on other sites More sharing options...
Pete Posted October 17, 2012 Share Posted October 17, 2012 Don't worry, when I started with PW everything I tried to do had an easier way of achieving it Quite often I'll scratch my head over something for hours one evening and then have a eureka moment an solve it the next morning after sleep and caffeine Link to comment Share on other sites More sharing options...
SiNNuT Posted October 17, 2012 Share Posted October 17, 2012 PW is a flexible tool. So if you wanted a way to set some site-wide settings and manage them from the admin you could: Create a template called something like "settings". This can be a file-less template. Create fields for the settings you wish to have, for example 'sitename' and 'companyslogan'. Add the fields to the settings template. Create a page with the template 'settings'. The page can be named anything but let's also call this 'settings'. Make the page hidden and publish. Now you can use this data in your templates using the PW api. $settings = $pages->get("/settings/"); <title><?= $settings->sitename; ?> | <?= $page->get("headline|title"); ?></title> <h2><?= $settings->companyslogan; ?></h2> This is only one way. Another way would be to do this settings in the config file. 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now