Where has my code gone in cornerstone

On my site live shows the title “Boots” with a line above and below, then the description under.
The title and description are obtained from a database and displayed.

When I look at the page in cornerstone, I see the text for description. But where has the text for the title gone

Hi @abc_lymmman,

Thanks for reaching out.

It’s only normal since it’s not integrated to the builder. And it looks like it’s PHP code snippets (Insert PHP) plugin’s limitation and was meant to execute on front-end. I recommend contacting the plugin author for this. It was made like that so you could still edit the code in the backend (WP Editor) which also affect the builder’s rendering.

Thanks!

Hello, sorry you have missed the point. Yes I use Insert_PHP to get the website text from a back-end database, this is working as expected.

You will notice my live page has the following:

The Buxton Guide
------------------------- Line
Boots
------------------------- Line
Some descriptive text
------------------------- Line

But when I look at the page in cornerstone I only see the following in my header layout

Insert_PHP code to get the description
------------------------- Line

The header layout used to have an Insert_PHP statement that had the select * from abc_data where … statement. This has now gone

Hi @abc_lymmman,

Yes, I fully understand that. Which is why I recommend contacting the plugin author. I also assume you’re referring the headline based on your screenshot and not the header. There is no way you could edit the header within the cornerstone builder.

To fully understand the plugin limitation, I created a sample page named X TEST (without the builder). And in the front page, it displays Hello World, but in the editor, it remains as the code to make sure you can still edit the code.

And that’s how the plugin works, it will not execute the code in the admin/backend.

Thanks!

yes sorry i refer to the headline not the heater.

I used to have the text that displayed the headline “Boots”
this was obtained using the code
[insert_php] echo $GLOBALS[‘title’];
[/insert_php]

this code has disappeared. it also contained a select statement and set up all the global variables.

I do not have any issue with how insert_php works or need to contact the the plug in author.

If I look at the page using edit rather than cornerstone, i see my code. (see attached)

Hi @abc_lymmman,

Looks like cache issue, adding the code doesn’t have this issue

[insert_php]

  $GLOBALS['page'] = 'boots';

  global $wpdb;

  $result = $wpdb->get_row($wpdb->prepare("SELECT * FROM abc_data WHERE page = %s", $GLOBALS['page'] ));
 
  $GLOBALS['advert'] = $result->advert;
  $GLOBALS['title'] = $result->title;
  $GLOBALS['description'] = $result->description;
  $GLOBALS['telephone'] = $result->telephone;
  $GLOBALS['website'] = $result->website;   
  $GLOBALS['address'] = $result->address;
  $GLOBALS['text_rhs'] = $result->text_rhs;
  $GLOBALS['map'] = $result->map;
  $GLOBALS['photo1'] = $result->photo1;
  $GLOBALS['gap_lhs'] = $result->gap_lhs;

  $GLOBALS['photo1_description'] = $result->photo1_description;
  $GLOBALS['opening_hours_notes'] = $result->opening_hours_notes;

  $GLOBALS['mon_open'] = $result->mon_open;
  $GLOBALS['mon_close'] = $result->mon_close;   

  $GLOBALS['tue_open'] = $result->tue_open;
  $GLOBALS['tue_close'] = $result->tue_close; 

  $GLOBALS['wed_open'] = $result->wed_open;
  $GLOBALS['wed_close'] = $result->wed_close; 

  $GLOBALS['thu_open'] = $result->thu_open;
  $GLOBALS['thu_close'] = $result->thu_close; 

  $GLOBALS['fri_open'] = $result->fri_open;
  $GLOBALS['fri_close'] = $result->fri_close; 

  $GLOBALS['sat_open'] = $result->sat_open;
  $GLOBALS['sat_close'] = $result->sat_close; 

  $GLOBALS['sun_open'] = $result->sun_open;
  $GLOBALS['sun_close'] = $result->sun_close;  

  echo $GLOBALS['title'];

[/insert_php]

I recommend re-adding them again by copying the code from the text editor, back to the builder. I tried this and it’s not happening on my installation. I also saved a backup in your Templates named SAMPLE X BOOTS.

Thanks!

Hello, this is an issue with cornerstone, not insert_php.

If i switch between the layout and text view (3rd button on left hand side, under ccs & JS) I clearly see my text, see attached. but when I change the view this text is not displayed.

Where is the element “classic custom headline” ? This is not shown in the layout view

I have cleared cache and tried this on different machines and they al do the same.

Hi There,

Would you mind adding your custom code to the v2 text element instead of the classic element?

Let us know how it goes!

What is v2 text. I have the options of “text” or “classic text”
My whole site uses classic text and classic custom headline.

Why does this classic custom headline text not show up in cornerstone.

I have added a second “classic custom headline” text and this shows up ok. So why doesn’t the first one ?

The Text element is the one @thai referred to.

The Classic Custom Headline will not accept new line spaces anymore. I’ve tested removing the spaces in your shortcode but this still won’t display your shortcode in the builder. See https://youtu.be/uRlNRhlI50o

The new or V2 elements would not display the output of your shortcode in the front-end. They will display it as is.

I’ll post this to our issue tracker for review. For now, the only solution for this is to switch to Skeleton Mode.

Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.