Community @ The Turning Gate

Support community for TTG plugins and products.

You are not logged in.

#1 Re: PHPlugins » Target Specific Pages in PHP » 2019-03-20 02:26:03


not new just yet Daniel, doing what I meant to do as advised by Matt some time ago. I have a grid of static links to Galleries and also the latest two Blog Posts. It's been there a while and works well but the html was just in the page copy. So I'm trying to move that code into the php.

Stage 1 completed, thank you. Stage 2 is to get the existing php for the blog posts working. Which I will probably need some pointers on....

Once I have that sorted, I can do other stuff smile

#2 Re: PHPlugins » Target Specific Pages in PHP » 2019-03-20 01:43:18

That Definitely works Daniel,

many thanks again for your help

#3 Re: PHPlugins » Target Specific Pages in PHP » 2019-03-20 00:44:00

Hi Rod,

hope you are well. Long story, thought I had the Answer, which was using: if ( $this->page_match("/")...

However, this worked on the Home page - and all the others too! Doh! So it wasn't the answer at all.

I found that if I just used - echo $_SERVER['REQUEST_URI']; it showed the url returned for the pages ie. /about/ and /contact/ for the about and contact pages. The home page returned / (backslash). However, using '/' or "/" as the match worked on all pages.

Now I'm back to trying over to find the right escapes to the 'if' statement. using '/contact' only targets the contact page etc. Just doesn't work on the home page.

Please, anyone chip in if you have any suggestions.

#5 Re: PHPlugins » Target Specific Pages in PHP » 2019-03-19 18:25:51


that worked brilliantly for every page on my site, now how do I get it to target the Home page! I've tried '/home', '/Home', 'home', '/', etc. etc.

What am I missing this time?

#7 PHPlugins » Target Specific Pages in PHP » 2019-03-19 01:50:15

Replies: 12

Hi Folks,

been a while!

Could someone please remind an old man how to target specific pages in PHP?

Used to go somewhat like:  if (G_PATH == 'HOME') {

But had no joy with that.....


#8 Re: PHPlugins » PHP Wordpress posts » 2018-11-06 22:18:23

Hi Matt,

that's fantastic, thank you very much! Thanks for the link Dan.

I have been going a little crazy trying to sort this, happy bunny now though smile

#9 Re: PHPlugins » PHP Wordpress posts » 2018-11-06 04:01:58

Hi Ben,

I thought that might be the case, however the only change is from BL1 to BL2, the code was copied as is and has worked fine up till now. Just thought there might be something I'd missed (I do that a lot these days) as this code seems to be very common on the net. I've done some forum stalking on the WP side and not come up with anything. It was a nice thing to have, so any ideas would be great.

#10 PHPlugins » PHP Wordpress posts » 2018-11-04 23:08:49

Replies: 7

Well, this is embarrassing!

For some time in CE4 and BL1 I have been using a piece of code in my home page to show a couple of the latest post excepts from my blog.

When use this code in my BL2 updated site I get a big red banner with this message:

Something went wrong
Class not found: Requests. To fix this, reinstall Backlight at /backlight/installer.
If the problem persists, please report error at in ClassFinder.php on line 55

I have been trying to find a fix to this but with no joy. Would appreciate some help if any of the PHP bods can point me in the right direction it would be very much appreciated.

I have removed the code for the time being so no link provided Rod, nothing to see right now smile

This is the code I have been using:

		require($_SERVER['DOCUMENT_ROOT'] . '/blog/wp-load.php'); 
		$args = array('posts_per_page' => 2);
		$latest_posts = new WP_Query( $args ); 	
		if ( $latest_posts->have_posts() ) {
			while ( $latest_posts->have_posts() ) {
	<div class="col_3 square__frame">
		<div class="square__content blog_pic">
			<a href="<?php the_permalink(); ?>">
				<?php if ( has_post_thumbnail() ) { ?>
					<span class="post_thumbnail"><?php the_post_thumbnail(); ?></span>
				<?php } ?>

	<div class="col_3 square__frame text">
		<div class="square__content left">
			<div class="square__padding">
				<div class="gallery_title">
					<?php the_title(); ?>
				<div class="gallery_text">
					<?php the_excerpt(); ?>
	<? } 
		} else {
			echo '<p>There are no posts available</p>';

#11 Re: Backlight Support » Moving a Sub Domain » 2018-03-08 22:45:39

Thanks Rod,

I assumed that I would have to update paths, but did not know whether there would be some buried nasties. Thanks for your reply, much appreciated as always...

#12 Backlight Support » Moving a Sub Domain » 2018-03-08 19:18:54

Replies: 3

Hi Guys,

been a while. Looking for a bit of advice, feel free to chip in. My main photography site is in a sub domain of our family web site on Bluehost. The family web site has been dismantled and does not exist any more and I want to move my photography site to be the primary. Bluehost help with the move and redirection and all that shmozzle, so no worries there. However my question is this; do I cut and paste the whole site into the new location and amend files, scripts setups etc. etc. or do I install a fresh copy of Backlight then export/Import templates and re-publish galleries all over again?

What do you guys think?

#13 Re: Backlight Support » Page Meta Description » 2017-12-05 03:26:24

OK Rod, you are officially a genius!

The php method described by Charlie does get the meta tags into the header but.... It does leave the empty descriptions behind as well.

By inserting an empty gallery with a description into the page not only is the meta description populated but the open graph description is populated too.

Excellent solution Rod. smile

#14 Re: Backlight Support » Page Meta Description » 2017-12-04 06:01:56

Yes that would work Rod, I thought  I could do that with my home page Theatre embed. Didn't think of an empty album though, that is smart! I might have a play with Charlies php but yours is fun too.

#16 Re: Backlight Support » Page Meta Description » 2017-12-04 04:26:52

Exactly Daniel, I thought that I had missed something. We should be able to set page specific meta description and keywords. SEO does not like the same description for all pages.

#17 Re: Backlight Support » Page Meta Description » 2017-12-04 02:55:51

Could be Rod, just a bit frustrating to have the meta description field there in the head without being able to put anything in it.....

#18 Re: Backlight Support » Page Meta Description » 2017-12-04 02:08:06

Hi Rod,

Yep, that's the one that prompted me to look. The guy has meta descriptions on all the headers on his pages, mine are just blank, must be php I guess. Haven't cracked it yet. sad

#19 Backlight Support » Page Meta Description » 2017-12-03 20:33:26

Replies: 15

Hi Guys,

Forgive me if I have missed a previous discussion and if so kindly point me to the previous..

How can I populate the Meta Description for Home, About, Blog, and Contact Pages? I know that the Album Description in the LR plugin does it for my Photo Albums, but struggling to get the set-up correct using php. I see the meta description line in the head using the Inspector, but the content is blank

Any help much appreciated


#20 Re: Backlight Showcase » Updated Site » 2017-10-20 03:55:12

Thanks Rod, you've got a bit more than me to update, to be fair smile

#21 Backlight Showcase » Updated Site » 2017-10-20 03:42:13

Replies: 5

A bit behind time, I know! But I have finally got my arse in gear and moved from okapi pages and galleries to pangolin on my main site, hope you like it.....

#22 General » To Lightroom or not to Lightroom » 2017-10-19 17:25:07

Replies: 11

Hi Guys,

Lots of chat on the interweb regarding the switch by Adobe to Subscription only versions of Lightroom despite stating that there would always be a perpetual license version. In light of this and Ben's reassurances on TTG's future; how do we all feel about sticking with Lightroom or jumping to another RAW editor? I have had a long look at Capture One, love it's Editing results, Speed, Interface. However it's DAM is a shadow of Lightroom. Their forums also have user complaints of upgrade costs for each new version.

So what do you think?


#25 Re: Backlight Showcase » New » 2017-03-03 00:53:30

Very Nice Philippe,

I like the Squares as well and use them for links.

Your images fit very well into your design, less is more....

Board footer

Powered by FluxBB