Jump to content

Archived

This topic is now archived and is closed to further replies.

mgwaters

Warning: Invalid argument supplied for foreach() error

Recommended Posts

mgwaters

I'm seeing the following error at the top of one of my client's sites:

 

Warning: Invalid argument supplied for foreach() in /home/lindawal/public_html/wp-content/themes/pagelines/includes/library.extend.php on line 83

 

I disabled plugins, which didn't solve the issue. 

Here is the code throwing the error from the library.extend.php file:

function base_check_templates() {

	if ( is_child_theme() ) {
		foreach ( glob( get_stylesheet_directory() . '/*.php', GLOB_NOSORT) as $file) {
			if ( preg_match( '/page\.([a-z-0-9]+)\.php/', $file, $match ) ) {
				$data = get_file_data( trailingslashit( get_stylesheet_directory() ) . basename( $file ), array( 'name' => 'Template Name' ) );
				if ( is_array( $data ) )
					pagelines_add_page( $match[1], $data['name'] );
			}
		}
	}
}

I'm using:

Pagelines Framework v2.4.5

Pagelines Base Theme v1.0.2

Wordpress v4.1

 

And here is the site:

http://www.lrwalker.com/

 

There was a missing style.css file in the child directory, which is strange. So I re-uploaded style.css file from my hard drive

but that didn't have any effect either.

 

Any help is greatly appreciated.

 

Thank you!

 

 

 

 

Share this post


Link to post
Share on other sites
Danny

Hi,

 

Where did you download the child theme from and also, can you copy and paste the contents of what you have in your child themes style.css file please. Because if there is a certain tag missing, your child theme will not act as a child theme.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
mgwaters

Hi Danny and thank you for your reply.

 

I downloaded the child theme from pagelines.com years ago now when Framework was the current product.

 

The following is the contents from the style.css for the Child Theme:

/*  
Theme Name: Base Theme
Theme URI: http://www.pagelines.com/
Description: A starter child theme for PageLines.  Use this as a reference for building your own child themes for PageLines Store.
Version: 1.0.2
Author: PageLines
Author URI: http://www.pagelines.com
Tags: developer

Template: pagelines

*/

/*
Themes follow the basic WordPress themes header scheme with the following additions:

	Template: pagelines
	Tells wordpress this is a childtheme and where the parent files are stored.
	
	Demo: http://a.link.com
	Use this to point to a demo for this product.
	
	External: http://a.link.com
	Use this to point to an external site, authors home page for example.	
*/

/*
 * File Naming Conventions
 * -------------------------------------
 *	style.css 		 - Main theme style file.
 *  thumb.png		 - Thumbnail image used in the store and on pagelines.com for your product.
 *  screenshot.png	 - Primary screenshot, logo or graphic for your extension item (300px by 225px).
 *	screenshot-1.png - Additional screenshots -1 -2 -3 etc (optional).
 *	page.example.php - Custom page template, check the file for syntax. This is autoloaded.
 *	sections/		 - Bundle sections with your theme in this folder, each section in a seperate folder.
 */


#branding {
	padding: 0;
	margin: 0;
	height: 128px;
	border-top-width: 8px;
	border-bottom-width: 8px;
	border-top-style: solid;
	border-bottom-style: solid;
	border-top-color: #657A5C;
	border-bottom-color: #657A5C;
	background-color: #D6CBBF;
	background-image: url(http://www.lrwalker.com/images/bannerTan2-2013.jpg);
	background-repeat: no-repeat;
}

#branding .content .content-pad {
	padding: 0 0 0 0;
	margin: 0 0 0 0;
/*	background-color: #D6CBBF !important; */
}
img.mainlogo-img {
margin: 0 0 0 50px;	
}
#nav_row {

}
ul#menu-nav {
float: right;	
}

ul.sf-menu li a:after {
    content: "/";
	margin: 0 4px 0 4px;
}

ul.sf-menu li:last-child a:after {
    content: "" !important;
}

ul.sf-menu li a {
    padding: 10px 0px 4px 0px;
	font-family:"Lucida Grande", sans-serif;
}

li.current_page_item a {
color:#657A5C;	
}

#nav .content-pad, #secondnav .content-pad {
    padding-bottom: 0;
}
.one-sidebar-right #column-main .mcolumn-pad, .two-sidebar-right #column-main .mcolumn-pad, .fullwidth #column-main .mcolumn-pad {
    padding: 14px 30px 0 43px;
	text-align:left;
}
#sidebar-wrap {
padding: 40px 0 0 0;	
text-align:center;
}
.entry_content h2 {
font-size:21px;
font-weight: 100;
margin: 20px 0 15px;
padding: 0;
}
.entry_content h4 {
    font-size: 18px;
    font-weight: 100;
    margin: 20px 0 0 0;
    padding: 0;
}

#sb_universal .textwidget{
	color: #918780;
	font-size: 80%;
	border-top-width: 1px;
	border-top-style: solid;
	border-top-color: #D6CEBE;
	line-height:120%;
	font-family:"Lucida Grande", sans-serif;
	margin: 0 20px 0 30px;
	text-align:center;
}
p.quote {
    color: #657A5C;
    font-family: Georgia,"Times New Roman",Times,serif;
    font-size: 17px;
    font-style: italic;
    line-height: 150%;
    margin: 0 0 8px;
    padding: 0px 15px 0 10px;
}
#sb_secondary {
text-align:center;	
}

img.portrait {
    border: 1px solid #8F7A67;
    margin: 0 0 15px;
    padding: 2px;
    text-align: center;
}
em.phone {
    color: #4B6441;
    font-family: Georgia,"Times New Roman",Times,serif;
    font-size: 18px;
    line-height: 120%;
    margin: 0 0 8px;
    padding: 0;
}
p.address {
    color: #5A4B40;
    font-family: Georgia,"Times New Roman",Times,serif;
    font-size: 13px;
    line-height: 120%;
    margin: 0 0 8px;
    padding: 0;
	text-align:center;
}
.entry_content ul, ol {
padding: 0 0 0 20px;
}
.entry_content ul li, ol li{
line-height:160%;
}
.entry_content ul.presentations li{
font-size:110%;
}
p.clientIntro {
width:80%;
font-size:115%;
line-height:150%;
margin: 0 0 15px 0;	
}

Share this post


Link to post
Share on other sites
Simon

The code is looking for a php template file in the child theme folder, there would have been one originally, you have deleted it probably.

Share this post


Link to post
Share on other sites
mgwaters

Yes, that was it. Both the functions.php and setup.php files were missing from the child theme folder on the server, as was the style.css file I mentioned earlier. That is strange as the site was functioning fine prior. Obviously something on our end. :(   Thank you for your help!

Share this post


Link to post
Share on other sites
Simon

You're welcome

Share this post


Link to post
Share on other sites

×