Jump to content

<?php echo "\n" sourcing


emrezaya

Recommended Posts

Hello,

I am guessing that this is a totally noob question and I am sorry about it. I am not someone who is familiar with php. I just can see what code says sometimes. I have a wordpress file which I wanted to edit. I was successful until I hit this line of code.

<?php echo "\n" . installedtheme::frontSections( ); ?>

This code is responsible for entire front page structure. When I delete this line my front page gets empty. In html side I can see </section> parts which I want to exclude but select what to exclude from code. I am guessing this echo calling a file that is told as front sections. I am lost. Is there any way to find and edit this file?

 

Thanks for help.

Link to comment
Share on other sites

If you don't know much about php WHY would you want to modify a block of code that is creating your entire front page???

Yes - this line does a php "echo" (ie, send something to the client/web page) to generate some output that is created by the method call to the 'frontSections()' function.  The line switches into php mode for the echo and call and then exits php mode so that you are then back in html mode.

Link to comment
Share on other sites

I don't know what theme or plugin you're using, but there are a couple potential issues with how you're going about things.

First, modifying the theme or plugin files directly is not recommended because every time the plugin or theme is updated, your changes will be overwritten. Usually in this type of situation, you'd check the files and documentation for action or filter hooks and use those to make your updates from your functions.php file. Working this way will allow those changes to remain after the plugin or theme updates because the actual theme or plugin files haven't been changed.

Another things is - given the name of the static method called (frontSections()) I assume this is calling your installed theme's functions that load the head and/or header templates into the page. These are crucial to the functioning of your site as it creates the top half of the HTML page - I think this is probably why you're seeing the WSOD when you remove this call. So, you know, don't do that.

Let us know what you're looking at and what about that you're trying to change, and I'm sure with the brains on this board you'll find the help you need to do what you want and do it correctly.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.