• Hi,

    I updated my company non-profit website and used the auto update, but this error appeared
    Fatal error: Call to undefined function c2c_get_custom() in /home///wp-content/themes/seaccusa/custom.php on line 68

    here is the line 68 code:
    `$nav1 = update($nav1, c2c_get_custom(‘nav1’), $overwrite);

    How can I make it works? I can login to dashboard

    Thanks

Viewing 9 replies - 1 through 9 (of 9 total)
  • Moderator James Huff

    (@macmanx)

    Try manually resetting your plugins (no Dashboard access required). If that resolves the issue, reactivate each one individually until you find the cause.

    If that does not resolve the issue, access your server via SFTP or FTP, or a file manager in your hosting account’s control panel, navigate to /wp-content/themes/ and rename the directory of your currently active theme. This will force the default theme to activate and hopefully rule-out a theme-specific issue (theme functions can interfere like plugins).

    Thread Starter pauln9

    (@pauln9)

    Hi James,
    Thanks for helping, but it’s not solved the problem. I click on the post view it’s display

    https://www.viet.seaccusa.org/2012/11/19/empowering-community-promoting-business/

    If I click on the sidebar link, it shows the fatal error that means something is wrong with the sidebar or the pages. Index page has fatal error too.

    Thanks

    Moderator James Huff

    (@macmanx)

    Ok, you still need to isolate what the problem is. Sorry, earlier I read “I can login to dashboard” as “I *can’t* login to dashboard.”

    Try deactivating all plugins. If that resolves the issue, reactivate each one individually until you find the cause.

    If that does not resolve the issue, try switching to the Twenty Seventeen theme to rule-out a theme-specific issue (theme functions can interfere like plugins).

    Thread Starter pauln9

    (@pauln9)

    Hi James,
    I tried deactivated all plugins, but it didn’t solve the problem, but new theme is working well. What I have to do with the old theme to make it works. Thanks

    Moderator James Huff

    (@macmanx)

    Where did you originally acquire the theme from?

    Thread Starter pauln9

    (@pauln9)

    Hi,

    I am not sure where it come from but under my organization theme name on Dashboard.
    I think if I can change this code to basic nav bar, it may work

    `$nav1 = update($nav1, c2c_get_custom(‘nav1’), $overwrite);

    Thanks

    Moderator James Huff

    (@macmanx)

    I suppose give that a shot, otherwise I recommend getting in touch with the person who built the theme, or upgrading to a newer theme.

    Thread Starter pauln9

    (@pauln9)

    Thanks for help. I don’t know who designed the theme to contact. People use to see our old website that why I try to fix it.

    I deleted line by line, but it shows the same error that mean the codes were not function well with wp new update

    <?php
    
    /*  
    Originally created by Jay Fienberg of Juxtaprose
    (c) copyright 2008
    
    In this file:
    All custom functions used in Juxtaprose-created 
    templates for WordPress powered sites
    
    These functions set variables 
    that can be used in templates:
    
    	$pagetitle
    	$metakeywords, $metadescription
    	$nav1, $nav2
    	$info1, $info2, $info3, $info4
    	$info5, $info6, $info7, $statement, $quote, $byline
    
    These correspond to custom values of the same name
    that can be set on a blog post or page 
    (except note: $pagetitle corresponds with 
    a custom value named title)
    */
    
    $homePageId = 20; //the id for the home page
    
    //$blogPageId is set in single.php for this site
    //since there are two blogs!
    //$blogPageId = ; // this id for the blog page
    
    // set the number of posts to show on the blog page
    //$blogSettings is set in blog.php
    
    //$blogSettings = 'showposts=5'; 
    
    function fetchCustomValues($forceBlog=false) {
    /* top level function for 
       grabbing custom values from current post / page
       if forceBlog=true, then fills in any blank values
       with the values from the page = $blogPageId set above
    */   
    	global $blogPageId, $info1, $info2, $info3, $info4, $info5, $info6, $info7, $inside, $quote, $byline;		
    	customValues();
    	if ($forceBlog) {
    		getBlogDefaults($blogPageId);		
    	} 
    	$info1 = getInfoZone($info1);
    	$info2 = getInfoZone($info2);
    	$info3 = getInfoZone($info3);
    	$info4 = getInfoZone($info4);
    	$info5 = getInfoZone($info5);
    	$info6 = getInfoZone($info6);
    	$info7 = getInfoZone($info7);
            $statement = getInfoZone($statement);
    		$quote = getInfoZone($quote);
    		$byline = getInfoZone($byline);
            $inside = 'id="inside" '; // overridden in home.php only	
    }
    
    function customValues($overwrite=true) {
    /* sets the template variables with the custom values 
       if overwrite=false, preserves the current value
       of the variable if it's not empty
    */
    	global $nav1, $nav2, $nav3, $pagetitle, $metadescription, $metakeywords, $info1, $info2, $info3, $info4, $info5, $info6, $info7, $statement, $quote, $byline;	
    	
    	$nav1 = update($nav1, c2c_get_custom('nav1'), $overwrite);
    $tabnav = update($nav2, c2c_get_custom('tabnav', $before=' '), $overwrite);	
    	$nav2 = update($nav2, c2c_get_custom('nav2', $before=' '), $overwrite);
    	$nav3 = update($nav2, c2c_get_custom('nav3', $before=' '), $overwrite);	
    	$pagetitle = update($pagetitle, c2c_get_custom('title'), $overwrite);
    	$metadescription = update($metadescription, c2c_get_custom('metadescription'), $overwrite);
    	$metakeywords = update($metakeywords, c2c_get_custom('metakeywords'), $overwrite);
    	
    	$info1 = update($info1, c2c_get_custom('info1'), $overwrite);
    	$info2 = update($info2, c2c_get_custom('info2'), $overwrite);
    	$info3 = update($info3, c2c_get_custom('info3'), $overwrite);
    	$info4 = update($info4, c2c_get_custom('info4'), $overwrite);
    	$info5 = update($info5, c2c_get_custom('info5'), $overwrite);
    	$info6 = update($info6, c2c_get_custom('info6'), $overwrite);
    	$info7 = update($info7, c2c_get_custom('info7'), $overwrite);
            $statement = update($statement, c2c_get_custom('statement'), $overwrite);	
    		$quote = update($quote, c2c_get_custom('quote'), $overwrite);	
    		$byline = update($byline, c2c_get_custom('byline'), $overwrite);	
    }
    function update($curval, $newval, $overwrite) {
    /* checks to see if a variable is empty and
       overwrites and returns new value, or preserves
       and returns current value
    */
    	$retval = $newval;
    	if ($overwrite==false) {
    		if (!empty($curval))
    			$retval = $curval;
    	}	
    	return $retval;
    }
    
    function getInfoZone($txt) {
    /* allows for "codes" in custom values to trigger
       code below. Results of code below is combined with
       static text in custom value for final output
    */
    	global $post, $wpdb;
    	$str = $txt;
    
    	/* return a list of recent blog posts */
    	if (strpos($txt,'BLOG:')===0) {
    		//BLOG: is characters 0-4
    		$end = strpos($txt, "|");		
    		if ($end > 5) {
    			$val = substr($txt, 5, $end-5);
    			$q = $val . "&showposts=4";		
    		} else {
    			$end = 5;
    			$q = "showposts=4";
    		}	
    		$str = substr($txt, $end+1);
    		$my_query = new WP_Query($q);
    		while ($my_query->have_posts()) : $my_query->the_post();
    			$str .= "\r\t\t\t<p><a href="">ID) . "\" rel=\"bookmark\" title=\"" . $post->post_title . "\">" . $post->post_title . "</a></p>";
    		endwhile;	
    		
    	/* return a list of categories */		
    	} else if (strpos($txt,'CAT:')===0) {
    		//CAT: is characters 0-3
    		$end = strpos($txt, "|");		
    		if ($end > 4) {
    			$val = substr($txt, 4, $end-4);
    			$q = $val;		
    		} else {
    			//$end = 4;
    			$q="";
    		}
    		$str = substr($txt, $end+1);
    		$str .= "\r<ul>\r";
    		ob_start();
    		wp_list_categories($q);
    		$str .= ob_get_contents();
    		$str .= "\r</ul>\r";		
    		ob_end_clean();	
    
    	/* return a list of archives */		
    	} else if (strpos($txt,'ARCHIVE:')===0) {
    		//CAT: is characters 0-7
    		$end = strpos($txt, "|");		
    		if ($end > 8) {
    			$val = substr($txt, 8, $end-8);
    			$q = $val;		
    		} else {
    			//$end = 4;
    			$q="";
    		}
    		$str = substr($txt, $end+1);
    		$str .= "\r<ul>\r";
    		ob_start();
    		wp_get_archives($q);
    		$str .= ob_get_contents();
    		$str .= "\r</ul>\r";		
    		ob_end_clean();	
    
    	/* return a list of categories as a tag cloud */				
    	} else if (strpos($txt,'TAG:')===0) {
    		//TAG: is characters 0-3
    		$end = strpos($txt, "|");		
    		if ($end > 4) {
    			$val = substr($txt, 4, $end-4);
    			$q = $val;		
    		} else {
    			//$end = 4;
    			$q="";
    		}
    //pre wp2.3		$qstr = "SELECT cat_ID, cat_name, category_count from wp_categories where category_count > 0 ORDER BY cat_name";
    		$qstr = "SELECT a.term_id, a.name, a.slug,  b.count from wp_terms a, wp_term_taxonomy b where a.term_id = b.term_id and b.count > 0 ORDER BY a.name";
    		$cats = $wpdb->get_results($qstr); 
    		$str = substr($txt, $end+1);
    		$str .= "<div class=\"cloud\">";
    		foreach ($cats as $cat)
    		{
    /* pre wp2.3
    			$catname = $cat->cat_name;
    			$catlink = get_category_link($cat->cat_ID);
    			$pstcnt = $cat->category_count;	
    */			
    			$catname = $cat->name;
    			$catlink = get_category_link($cat->term_id);
    			$pstcnt = $cat->count;	
    			if ($pstcnt > 12) $pstcnt = 12;
    			$str .= "<a href=\"" . $catlink ."\" ";
    			$str .= "class=\"s" . $pstcnt . "\">";
    			$str .= $catname . "</a> ";
    		}	
    		$str .= "</div>";
    	}
    	return $str;
    }
    
    function getBlogDefaults($id) {
    /* uses the blog page as the source for custom values
       and sets any values that are not already set by the
       current page
    */
    		global $post;
    		$holdpost = $post;
    		$temp_query = new WP_Query('page_id=' . $id);
    		while ($temp_query->have_posts()) : $temp_query->the_post();
    			customValues(false);
    		endwhile;
    		$post = $holdpost;
    }
    
    function getArchiveYearLinks($catlist, $not="false", $prefix="", $suffix="", $urlpre="/posts/") {
    	global $wpdb;
    	$qstr = "select distinct year(post_date) as yr from wp_posts, wp_term_relationships where ID=object_id and post_type='post' and term_taxonomy_id " . $not . " in(" . $catlist .") order by yr desc";
    	$arcs = $wpdb->get_results($qstr); 
    	$str = "";
    	foreach ($arcs as $arc) {
    		$str .= $prefix . '<a>yr . '">' . $arc->yr . '</a>' . $suffix;
    	}
    	return $str;
    }
    
    ?>

    Can you help me which code I add or change to make it works. Thanks

    Moderator James Huff

    (@macmanx)

    I regret I don’t have the time to dig in that deeply currently.

    In this case, usually I recommend switching to a more up to date theme, as you’ll likely find more problems down the line. There are 4,876 free themes to choose from at https://ww.wp.xz.cn/themes/browse/new/

    If you want to continue to use the old theme, you may need to hire someone to work on it. For that, please try https://jobs.wordpress.net/ or https://jetpack.pro/ and do not accept any hire or direct access offers posted to these forums.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Fatal error: Call to undefined function c2c_get_custom() in /home//custom.php’ is closed to new replies.