HEX
HEX
Server: Apache/2
System: Linux server.lbnode.com 5.15.0-134-generic #145-Ubuntu SMP Wed Feb 12 20:08:39 UTC 2025 x86_64
User: famous (1004)
PHP: 8.1.32
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/famous/domains/famousphysicists.org/public_html/wp-content/themes/famous2/functions.php
<?php
// Include required Image Functions File
require_once('functions/get-the-image.php');

if ( function_exists('register_sidebar') ) {

	register_sidebar(array(
		'name'=>'Sidebar',
		'description' => 'This is the primary sidebar.',
		'before_title'=>'<h4 class="widgettitle">','after_title'=>'</h4>'
	));
}

//Limit # of posts per page for category & search
function limit_posts_per_archive_page() { 
       if ( is_category() ) 
          $limit = 30; 
       elseif ( is_search() ) 
          $limit = 30; 
       else 
          $limit = get_option('posts_per_page'); 

       set_query_var('posts_per_archive_page', $limit); 
} 

add_filter('pre_get_posts', 'limit_posts_per_archive_page');  

/**
 * Tests if any of a post's assigned categories are descendants of target categories
 *
 * @param int|array $cats The target categories. Integer ID or array of integer IDs
 * @param int|object $_post The post. Omit to test the current post in the Loop or main query
 * @return bool True if at least 1 of the post's categories is a descendant of any of the target categories
 * @see get_term_by() You can get a category by name or slug, then pass ID to this function
 * @uses get_term_children() Passes $cats
 * @uses in_category() Passes $_post (can be empty)
 * @version 2.7
 * @link http://codex.wordpress.org/Function_Reference/in_category#Testing_if_a_post_is_in_a_descendant_category
 */
function post_is_in_descendant_category( $cats, $_post = null )
{
	foreach ( (array) $cats as $cat ) {
		// get_term_children() accepts integer ID only
		$descendants = get_term_children( (int) $cat, 'category');
		if ( $descendants && in_category( $descendants, $_post ) )
			return true;
	}
	return false;
}

add_filter('is_protected_meta', 'not_protect_headspace_meta', null, 2);
function not_protect_headspace_meta($protected, $meta_key) {
	if (strpos($meta_key, '_headspace_', 0) === 0) {
		return $true;
	}

	return $protected;
}

// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
	'primary' => 'Primary Navigation'
) );
?>