Jump to content

<?php echo "\n" sourcing

Recommended Posts


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.

Share this post

Link to post
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.

Share this post

Link to post
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.

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now


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.