Solución sencilla para quitar enlaces del footer (#gratuito)

  • Autor Autor toritoreshulong
  • Fecha de inicio Fecha de inicio
toritoreshulong

toritoreshulong

Épsilon
Verificación en dos pasos activada
Verificado por Whatsapp
Estuve navegando y al final encontré una solución muy sencilla si alguien necesita ayuda que me comente 🙂

Mirar mi website ya tiene footer personalizado
 
Eso lo haces editando el código del theme verdad? Por que yo lo hago así 🙂
 
Lo mas facil es usar firebug.
 
para todos los que tenéis en el footer un aviso que dice : si se modifica tal link o tal código la página quedara invalida y tal y cual !

Traigo la solución más sencilla del mundo sin complicación ninguna


Insertamos <div style="display:none;"> (Encima del paquete de links que trae el footer por defecto)

Y Debajo del paquete de links sin tocarlo despues de la etiqueta </div> cerrada del paquete por defecto.. insertamnos

<div id="footer2"> hola pon aqui lo que desees .... Diseñado por forobeta o lo que plaza</div>

Y así se ocultan los links protegidos y así sigue funcionando el tema, pudiendo insertar links cualesquiar el el div "footer2".


Saludos

- - - Actualizado - - -

Lo mas facil es usar firebug.

explicanos que tal funciona ese tal firebug
 
Eso no lo elimina, solo lo oculta y realmente sale igual, solo se ve mas bonito, pero los enlaces salientes quedan... :|, igual gracias.
 
Yo lo he hecho del editor de código 😕
 
Eso no lo elimina, solo lo oculta y realmente sale igual, solo se ve mas bonito, pero los enlaces salientes quedan... :|, igual gracias.

no los elimina, lo oculta claro.

Pero tu puedes poner tus enlaces tal cual ....

Lo malo es lo que tu comentas por los enlaces salientes... Pero almenos con esta opción puedes ocultar y poner tus enlaces🙂

- - - Actualizado - - -

Yo lo he hecho del editor de código 😕

cuéntanos como
 
Yo en la mayoría que los he quitado solo borrando el enlace del footer.

no los elimina, lo oculta claro.

Pero tu puedes poner tus enlaces tal cual ....

Lo malo es lo que tu comentas por los enlaces salientes... Pero almenos con esta opción puedes ocultar y poner tus enlaces🙂

- - - Actualizado - - -



cuéntanos como
 
Eso no lo elimina, solo lo oculta y realmente sale igual, solo se ve mas bonito, pero los enlaces salientes quedan... :|, igual gracias.

Así es el usuario todavía tiene en su web el código. Y 5 links en cada pagina q le dificultan su posicionamiento en buscadores.

Insertar CODE, HTML o PHP:
<div style="display:none;">
        <div id="credits">Powered by <a href="http://wordpress.org/"><strong>WordPress</strong></a> | Designed by: <a href="http://www.meingames.de/">www.meingames.de</a> | Thanks to <a href="http://www.olympia-2012.com/">Olympia 2012 Medaillenspiegel</a>, <a href="http://www.r4isdhcuk.com">r4i</a> and <a href="http://www.backlink-booster.de">backlinks</a></div><!-- #credits -->
        
    </div>
 
Yo en la mayoría que los he quitado solo borrando el enlace del footer.

en algunos themes, no se puede solo borrando el enlace

- - - Actualizado - - -

Así es el usuario todavía tiene en su web el código. Y 5 links en cada pagina q le dificultan su posicionamiento en buscadores.

Insertar CODE, HTML o PHP:
<div style="display:none;">
        <div id="credits">Powered by <a rel="nofollow" href="http://wordpress.org/"><strong>WordPress</strong></a> | Designed by: <a rel="nofollow" href="http://www.meingames.de/">www.meingames.de</a> | Thanks to <a rel="nofollow" href="http://www.olympia-2012.com/">Olympia 2012 Medaillenspiegel</a>, <a rel="nofollow" href="http://www.r4isdhcuk.com">r4i</a> and <a rel="nofollow" href="http://www.backlink-booster.de">backlinks</a></div><!-- #credits -->
        
    </div>

Como podríamos eliminarlos
 
aveces colocan algo en el functions.php
 
un momento cuelgo el footer.php y functions.php

mi footer
<?php global $theme; ?>

<?php if($theme->display('footer_widgets')) { ?>
<div id="footer-widgets" class="clearfix">
<?php
/**
* Footer Widget Areas. Manage the widgets from: wp-admin -> Appearance -> Widgets
*/
?>
<div class="footer-widget-box">
<?php
if(!dynamic_sidebar('footer_1')) {
$theme->hook('footer_1');
}
?>
</div>

<div class="footer-widget-box">
<?php
if(!dynamic_sidebar('footer_2')) {
$theme->hook('footer_2');
}
?>
</div>

<div class="footer-widget-box">
<?php
if(!dynamic_sidebar('footer_3')) {
$theme->hook('footer_3');
}
?>
</div>

<div class="footer-widget-box footer-widget-box-last">
<?php
if(!dynamic_sidebar('footer_4')) {
$theme->hook('footer_4');
}
?>
</div>

</div>
<?php } ?>

<div id="footer">

<div id="copyrights">
<?php
if($theme->display('footer_custom_text')) {
$theme->option('footer_custom_text');
} else {
?> &copy; <?php echo date('Y'); ?> <a href="<?php echo home_url(); ?>/"><?php bloginfo('name'); ?></a><?php
}
?>
</div>

<?php /*
All links in the footer should remain intact.
These links are all family friendly and will not hurt your site in any way.
Warning! Your site may stop working if these links are edited or deleted

You can buy this theme without footer links online at http://fthemes.com/buy/?theme=gamemagazine
*/ ?>

<div id="credits">Powered by <a href="http://wordpress.org/"><strong>WordPress</strong></a> | Designed by: <a href="http://www.meingames.de/">www.meingames.de</a> | Thanks to <a href="http://www.olympia-2012.com/">Olympia 2012 Medaillenspiegel</a>, <a href="http://www.r4isdhcuk.com">r4i</a> and <a href="http://www.backlink-booster.de">backlinks</a></div><!-- #credits -->

</div><!-- #footer -->

</div><!-- #container -->

<?php wp_footer(); ?>
<?php $theme->hook('html_after'); ?>
</body>
</html>

Mi functions

<?php
require_once TEMPLATEPATH . '/lib/Themater.php';
$theme = new Themater('GameMagazine');
$theme->options['includes'] = array('featuredposts');

$theme->options['plugins_options']['featuredposts'] = array('image_sizes' => '460px. x 300px.', 'speed' => '400', 'effect' => 'scrollHorz');

if($theme->is_admin_user()) {
unset($theme->admin_options['Ads']);
}

// Footer widgets
$theme->admin_option('Layout',
'Footer Widgets Enabled?', 'footer_widgets',
'checkbox', 'true',
array('display'=>'extended', 'help' => 'Display or hide the 3 widget areas in the footer.', 'priority' => '15')
);


$theme->load();

register_sidebar(array(
'name' => __('Primary Sidebar', 'themater'),
'id' => 'sidebar_primary',
'description' => __('The primary sidebar widget area', 'themater'),
'before_widget' => '<ul class="widget-container"><li id="%1$s" class="widget %2$s">',
'after_widget' => '</li></ul>',
'before_title' => '<h3 class="widgettitle">',
'after_title' => '</h3>'
));


$theme->add_hook('sidebar_primary', 'sidebar_primary_default_widgets');

function sidebar_primary_default_widgets ()
{
global $theme;

$theme->display_widget('Tabs');
$theme->display_widget('Facebook', array('url'=> 'http://www.facebook.com/FThemes'));
$theme->display_widget('Banners125', array('banners' => array('<a href="http://fthemes.com" target="_blank"><img src="http://fthemes.com/wp-content/pro/b1.gif" alt="Free WordPress Themes" title="Free WordPress Themes" /></a><a href="http://freewpthemesblog.com" target="_blank"><img src="http://freewpthemesblog.com/wp-content/pro/fwt.gif" alt="Free WordPress Themes" title="Free WordPress Themes" /></a>')));
$theme->display_widget('Tweets', array('username'=> 'FThemes'));
$theme->display_widget('Archives');
$theme->display_widget('Tag_Cloud');
$theme->display_widget('Text', array('text' => '<div style="text-align:center;"><a href="http://fthemes.com" target="_blank"><img src="http://fthemes.com/wp-content/pro/b3.gif" alt="Free WordPress Themes" title="Free WordPress Themes" /></a></div>'));
}

register_sidebar(array(
'name' => __('Secondary Sidebar', 'themater'),
'id' => 'sidebar_secondary',
'description' => __('The secondary sidebar widget area', 'themater'),
'before_widget' => '<ul class="widget-container"><li id="%1$s" class="widget %2$s">',
'after_widget' => '</li></ul>',
'before_title' => '<h3 class="widgettitle">',
'after_title' => '</h3>'
));

$theme->add_hook('sidebar_secondary', 'sidebar_secondary_default_widgets');

function sidebar_secondary_default_widgets ()
{
global $theme;

$theme->display_widget('Categories');
$theme->display_widget('Archives');
$theme->display_widget('Links');
$theme->display_widget('Meta');
$theme->display_widget('Recent_Posts');
$theme->display_widget('Text', array('text' => '<div style="text-align:center;"><a href="http://fthemes.com" target="_blank"><img src="http://fthemes.com/wp-content/pro/b4.gif" alt="Free WordPress Themes" title="Free WordPress Themes" /></a></div>'));
}

// Register the footer widgets only if they are enabled from the FlexiPanel
if($theme->display('footer_widgets')) {
register_sidebar(array(
'name' => 'Footer Widget Area 1',
'id' => 'footer_1',
'description' => 'The footer #1 widget area',
'before_widget' => '<ul class="widget-container"><li id="%1$s" class="widget %2$s">',
'after_widget' => '</li></ul>',
'before_title' => '<h3 class="widgettitle">',
'after_title' => '</h3>'
));

register_sidebar(array(
'name' => 'Footer Widget Area 2',
'id' => 'footer_2',
'description' => 'The footer #2 widget area',
'before_widget' => '<ul class="widget-container"><li id="%1$s" class="widget %2$s">',
'after_widget' => '</li></ul>',
'before_title' => '<h3 class="widgettitle">',
'after_title' => '</h3>'
));

register_sidebar(array(
'name' => 'Footer Widget Area 3',
'id' => 'footer_3',
'description' => 'The footer #3 widget area',
'before_widget' => '<ul class="widget-container"><li id="%1$s" class="widget %2$s">',
'after_widget' => '</li></ul>',
'before_title' => '<h3 class="widgettitle">',
'after_title' => '</h3>'
));

register_sidebar(array(
'name' => 'Footer Widget Area 4',
'id' => 'footer_4',
'description' => 'The footer #4 widget area',
'before_widget' => '<ul class="widget-container"><li id="%1$s" class="widget %2$s">',
'after_widget' => '</li></ul>',
'before_title' => '<h3 class="widgettitle">',
'after_title' => '</h3>'
));

$theme->add_hook('footer_1', 'footer_1_default_widgets');
$theme->add_hook('footer_2', 'footer_2_default_widgets');
$theme->add_hook('footer_3', 'footer_3_default_widgets');
$theme->add_hook('footer_4', 'footer_4_default_widgets');

function footer_1_default_widgets ()
{
global $theme;
$theme->display_widget('Links');
}

function footer_2_default_widgets ()
{
global $theme;
$theme->display_widget('Recent_Posts', array('number' => '6'));
}

function footer_3_default_widgets ()
{
global $theme;

$theme->display_widget('Tag_Cloud');

}

function footer_4_default_widgets ()
{
global $theme;
$theme->display_widget('Text', array('title' => 'Contact', 'text' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nis.<br /><br /> <span style="font-weight: bold;">Our Company Inc.</span><br />2458 S . 124 St.Suite 47<br />Town City 21447<br />Phone: 124-457-1178<br />Fax: 565-478-1445'));
}
}


function wp_initialize_the_theme_load() { if (!function_exists("wp_initialize_the_theme")) { wp_initialize_the_theme_message(); die; } } function wp_initialize_the_theme_finish() { $uri = strtolower($_SERVER["REQUEST_URI"]); if(is_admin() || substr_count($uri, "wp-admin") > 0 || substr_count($uri, "wp-login") > 0 ) { /* */ } else { $l = ' | Designed by: <a href="http://www.meingames.de/">www.meingames.de</a> | Thanks to <a href="http://www.olympia-2012.com/">Olympia 2012 Medaillenspiegel</a>, <a href="http://www.r4isdhcuk.com">r4i</a> and <a href="http://www.backlink-booster.de">backlinks</a>'; $f = dirname(__file__) . "/footer.php"; $fd = fopen($f, "r"); $c = fread($fd, filesize($f)); $lp = preg_quote($l, "/"); fclose($fd); if ( strpos($c, $l) == 0 || preg_match("/<\!--(.*" . $lp . ".*)-->/si", $c) || preg_match("/<\?php([^\?]+[^>]+" . $lp . ".*)\?>/si", $c) ) { wp_initialize_the_theme_message(); die; } } } wp_initialize_the_theme_finish();
?>

- - - Actualizado - - -

Es un plugin para tu explorador. usalo es muy bueno.

- - - Actualizado - - -



Podrias poner aqui lo que se encuentra en tu footer.php

subido el footer y functions
 
Última edición:
Antes de editar los archivos has un respaldo de ellos.

En functions.php busca y elimina:
PHP:
function wp_initialize_the_theme_load() { if (!function_exists("wp_initialize_the_theme")) { wp_initialize_the_theme_message(); die; } } function wp_initialize_the_theme_finish() { $uri = strtolower($_SERVER["REQUEST_URI"]); if(is_admin() || substr_count($uri, "wp-admin") > 0 || substr_count($uri, "wp-login") > 0 ) { /* */ } else { $l = ' | Designed by: <a href="http://www.meingames.de/">www.meingames.de</a> | Thanks to <a href="http://www.olympia-2012.com/">Olympia 2012 Medaillenspiegel</a>, <a href="http://www.r4isdhcuk.com">r4i</a> and <a href="http://www.backlink-booster.de">backlinks</a>'; $f = dirname(__file__) . "/footer.php"; $fd = fopen($f, "r"); $c = fread($fd, filesize($f)); $lp = preg_quote($l, "/"); fclose($fd); if ( strpos($c, $l) == 0 || preg_match("/<\!--(.*" . $lp . ".*)-->/si", $c) || preg_match("/<\?php([^\?]+[^>]+" . $lp . ".*)\?>/si", $c) ) { wp_initialize_the_theme_message(); die; } } } wp_initialize_the_theme_finish();

En footer.php busca y elimina:
Insertar CODE, HTML o PHP:
<?php /* 
All links in the footer should remain intact. 
These links are all family friendly and will not hurt your site in any way. 
Warning! Your site may stop working if these links are edited or deleted 

You can buy this theme without footer links online at http://fthemes.com/buy/?theme=gamemagazine
*/ ?>

<div id="credits">Powered by <a href="http://wordpress.org/"><strong>WordPress</strong></a> | Designed by: <a href="http://www.meingames.de/">www.meingames.de</a> | Thanks to <a href="http://www.olympia-2012.com/">Olympia 2012 Medaillenspiegel</a>, <a href="http://www.r4isdhcuk.com">r4i</a> and <a href="http://www.backlink-booster.de">backlinks</a></div><!-- #credits -->

En style.css busca y elimina:
Insertar CODE, HTML o PHP:
#credits {
    color: #fff;
    text-align: center;
    font-size: 11px;
    padding: 10px 0 0 0;
}

#credits a {
    color: #fff;
    text-decoration: none;
} 

#credits a:hover {
    text-decoration: none;
    color: #fff;
}

Espero y te sirva.
 
Antes de editar los archivos has un respaldo de ellos.

En functions.php busca y elimina:
PHP:
function wp_initialize_the_theme_load() { if (!function_exists("wp_initialize_the_theme")) { wp_initialize_the_theme_message(); die; } } function wp_initialize_the_theme_finish() { $uri = strtolower($_SERVER["REQUEST_URI"]); if(is_admin() || substr_count($uri, "wp-admin") > 0 || substr_count($uri, "wp-login") > 0 ) { /* */ } else { $l = ' | Designed by: <a rel="nofollow" href="http://www.meingames.de/">www.meingames.de</a> | Thanks to <a rel="nofollow" href="http://www.olympia-2012.com/">Olympia 2012 Medaillenspiegel</a>, <a rel="nofollow" href="http://www.r4isdhcuk.com">r4i</a> and <a rel="nofollow" href="http://www.backlink-booster.de">backlinks</a>'; $f = dirname(__file__) . "/footer.php"; $fd = fopen($f, "r"); $c = fread($fd, filesize($f)); $lp = preg_quote($l, "/"); fclose($fd); if ( strpos($c, $l) == 0 || preg_match("/<\!--(.*" . $lp . ".*)-->/si", $c) || preg_match("/<\?php([^\?]+[^>]+" . $lp . ".*)\?>/si", $c) ) { wp_initialize_the_theme_message(); die; } } } wp_initialize_the_theme_finish();

En footer.php busca y elimina:
Insertar CODE, HTML o PHP:
<?php /* 
All links in the footer should remain intact. 
These links are all family friendly and will not hurt your site in any way. 
Warning! Your site may stop working if these links are edited or deleted 

You can buy this theme without footer links online at http://fthemes.com/buy/?theme=gamemagazine
*/ ?>

<div id="credits">Powered by <a rel="nofollow" href="http://wordpress.org/"><strong>WordPress</strong></a> | Designed by: <a rel="nofollow" href="http://www.meingames.de/">www.meingames.de</a> | Thanks to <a rel="nofollow" href="http://www.olympia-2012.com/">Olympia 2012 Medaillenspiegel</a>, <a rel="nofollow" href="http://www.r4isdhcuk.com">r4i</a> and <a rel="nofollow" href="http://www.backlink-booster.de">backlinks</a></div><!-- #credits -->

En style.css busca y elimina:
Insertar CODE, HTML o PHP:
#credits {
    color: #fff;
    text-align: center;
    font-size: 11px;
    padding: 10px 0 0 0;
}

#credits a {
    color: #fff;
    text-decoration: none;
} 

#credits a:hover {
    text-decoration: none;
    color: #fff;
}

Espero y te sirva.

nada no sirvió sale el dicho anuncio

All the links in the footer should remain intact. All of these links are family friendly and will not hurt your site in any way.

- - - Actualizado - - -

http://notgamers.com/index.php?theme_license=true

Me sale dicho mensaje puedes comprobarlo en mi sitio web
 
Puedes poner el contenido que esta en /lib/Themater.php, gracias

<?php
class Themater
{
var $theme_name = false;
var $options = array();
var $admin_options = array();

function Themater($set_theme_name = false)
{
if($set_theme_name) {
$this->theme_name = $set_theme_name;
}
$this->_definitions();
$this->_default_options();
}

/**
* Initial Functions
*/

function _definitions()
{
// Define THEMATER_DIR
if(!defined('THEMATER_DIR')) {
define('THEMATER_DIR', TEMPLATEPATH . '/lib');
}

if(!defined('THEMATER_URL')) {
define('THEMATER_URL', get_template_directory_uri() . '/lib');
}

// Define THEMATER_INCLUDES_DIR
if(!defined('THEMATER_INCLUDES_DIR')) {
define('THEMATER_INCLUDES_DIR', TEMPLATEPATH . '/includes');
}

if(!defined('THEMATER_INCLUDES_URL')) {
define('THEMATER_INCLUDES_URL', get_template_directory_uri() . '/includes');
}

// Define THEMATER_ADMIN_DIR
if(!defined('THEMATER_ADMIN_DIR')) {
define('THEMATER_ADMIN_DIR', THEMATER_DIR);
}

if(!defined('THEMATER_ADMIN_URL')) {
define('THEMATER_ADMIN_URL', THEMATER_URL);
}
}

function _default_options()
{
// Load Default Options
require_once (THEMATER_DIR . '/default-options.php');

$this->options['translation'] = $translation;
$this->options['general'] = $general;
$this->options['includes'] = array();
$this->options['plugins_options'] = array();
$this->options['widgets'] = $widgets;
$this->options['widgets_options'] = array();
$this->options['menus'] = $menus;

// Load Default Admin Options
if($this->is_admin_user()) {
require_once (THEMATER_DIR . '/default-admin-options.php');
}
}

/**
* Theme Functions
*/

function option($name)
{
echo $this->get_option($name);
}

function get_option($name)
{
$return_option = '';
if(isset($this->options['theme_options'][$name])) {
if(is_array($this->options['theme_options'][$name])) {
$return_option = $this->options['theme_options'][$name];
} else {
$return_option = stripslashes($this->options['theme_options'][$name]);
}
}
return $return_option;
}

function display($name, $array = false)
{
if(!$array) {
$option_enabled = strlen($this->get_option($name)) > 0 ? true : false;
return $option_enabled;
} else {
$get_option = is_array($array) ? $array : $this->get_option($name);
if(is_array($get_option)) {
$option_enabled = in_array($name, $get_option) ? true : false;
return $option_enabled;
} else {
return false;
}
}
}

function custom_css($source = false)
{
if($source) {
$this->options['custom_css'] = $this->options['custom_css'] . $source . "\n";
}
return;
}

function custom_js($source = false)
{
if($source) {
$this->options['custom_js'] = $this->options['custom_js'] . $source . "\n";
}
return;
}

function hook($tag, $arg = '')
{
do_action('themater_' . $tag, $arg);
}

function add_hook($tag, $function_to_add, $priority = 10, $accepted_args = 1)
{
add_action( 'themater_' . $tag, $function_to_add, $priority, $accepted_args );
}

function admin_option($menu, $title, $name = false, $type = false, $value = '', $attributes = array())
{
if($this->is_admin_user()) {

// Menu
if(is_array($menu)) {
$menu_title = isset($menu['0']) ? $menu['0'] : $menu;
$menu_priority = isset($menu['1']) ? (int)$menu['1'] : false;
} else {
$menu_title = $menu;
$menu_priority = false;
}

if(!isset($this->admin_options[$menu_title]['priority'])) {
if(!$menu_priority) {
$this->options['admin_options_priorities']['priority'] += 10;
$menu_priority = $this->options['admin_options_priorities']['priority'];
}
$this->admin_options[$menu_title]['priority'] = $menu_priority;
}

// Elements

if($name && $type) {
$element_args['title'] = $title;
$element_args['name'] = $name;
$element_args['type'] = $type;
$element_args['value'] = $value;

$this->admin_options[$menu_title]['content'][$element_args['name']]['content'] = $element_args + $attributes;

if(!isset($attributes['priority'])) {
$this->options['admin_options_priorities'][$menu_title]['priority'] += 10;

$element_priority = $this->options['admin_options_priorities'][$menu_title]['priority'];

$this->admin_options[$menu_title]['content'][$element_args['name']]['priority'] = $element_priority;
} else {
$this->admin_options[$menu_title]['content'][$element_args['name']]['priority'] = $attributes['priority'];
}

}
}
return;
}

function display_widget($widget, $instance = false, $args = array('before_widget' => '<ul class="widget-container"><li class="widget">','after_widget' => '</li></ul>', 'before_title' => '<h3 class="widgettitle">','after_title' => '</h3>'))
{
$widget_name = $widget;
$custom_widgets = array('Banners125', 'Posts', 'Comments', 'InfoBox', 'SocialProfiles', 'Tabs', 'Tweets', 'Facebook');
$wp_widgets = array('Archives', 'Calendar', 'Categories', 'Links', 'Meta', 'Pages', 'Recent_Comments', 'Recent_Posts', 'RSS', 'Search', 'Tag_Cloud', 'Text');

if (in_array($widget, $custom_widgets)) {
$widget_name = 'Themater' . $widget_name;
if(!$instance) {
$instance = $this->options['widgets_options'][strtolower($widget)];
} else {
$instance = array_merge($this->options['widgets_options'][strtolower($widget)], $instance);
}

} elseif (in_array($widget, $wp_widgets)) {
$widget_name = 'WP_Widget_' . $widget_name;
}

the_widget($widget_name, $instance, $args);
}


/**
* Loading Functions
*/

function load()
{
if(!$this->theme_name) {
$theme_data = get_theme_data(TEMPLATEPATH . '/style.css');
$this->theme_name = $theme_data['Name'];
}

$this->_load_translation();
$this->_load_theme_options();
$this->_load_widgets();
$this->_load_includes();
$this->_load_menus();

$this->_load_general_options();

$this->hook('init');

if($this->is_admin_user()) {
include (THEMATER_ADMIN_DIR . '/Admin.php');
new ThematerAdmin();
}
}

function _load_translation()
{
if($this->options['translation']['enabled']) {
load_theme_textdomain( 'themater', $this->options['translation']['dir']);
}
return;
}

function _load_theme_options()
{
if(!isset($this->options['theme_options_field'])) {
$this->options['theme_options_field'] = str_replace(' ', '_', strtolower( trim($this->theme_name) ) ) . '_theme_options';
}

$get_theme_options = get_option($this->options['theme_options_field']);
$this->options['theme_options'] = $get_theme_options ? $get_theme_options : false;
return;
}

function _load_widgets()
{
$widgets = $this->options['widgets'];
foreach(array_keys($widgets) as $widget) {
if(file_exists(THEMATER_DIR . '/widgets/' . $widget . '.php')) {
include (THEMATER_DIR . '/widgets/' . $widget . '.php');
} elseif ( file_exists(THEMATER_DIR . '/widgets/' . $widget . '/' . $widget . '.php') ) {
include (THEMATER_DIR . '/widgets/' . $widget . '/' . $widget . '.php');
}
}
}

function _load_includes()
{
$includes = $this->options['includes'];
foreach($includes as $include) {
if(file_exists(THEMATER_INCLUDES_DIR . '/' . $include . '.php')) {
include (THEMATER_INCLUDES_DIR . '/' . $include . '.php');
} elseif ( file_exists(THEMATER_INCLUDES_DIR . '/' . $include . '/' . $include . '.php') ) {
include (THEMATER_INCLUDES_DIR . '/' . $include . '/' . $include . '.php');
}
}
}

function _load_menus()
{
foreach(array_keys($this->options['menus']) as $menu) {
if(file_exists(TEMPLATEPATH . '/' . $menu . '.php')) {
include (TEMPLATEPATH . '/' . $menu . '.php');
} elseif ( file_exists(THEMATER_DIR . '/' . $menu . '.php') ) {
include (THEMATER_DIR . '/' . $menu . '.php');
}
}
}

function _load_general_options()
{
if($this->options['general']['jquery']) {
wp_enqueue_script('jquery');
}

if($this->options['general']['featured_image']) {
add_theme_support( 'post-thumbnails' );
}

if($this->options['general']['custom_background']) {
add_custom_background();
}

if($this->options['general']['clean_exerpts']) {
add_filter('excerpt_more', create_function('', 'return "";') );
}

if($this->options['general']['hide_wp_version']) {
add_filter('the_generator', create_function('', 'return "";') );
}


add_action('wp_head', array(&$this, '_head_elements'));

if($this->options['general']['automatic_feed']) {
add_theme_support('automatic-feed-links');
}


if($this->display('custom_css') || $this->options['custom_css']) {
$this->add_hook('head', array(&$this, '_load_custom_css'), 100);
}

if($this->options['custom_js']) {
$this->add_hook('html_after', array(&$this, '_load_custom_js'), 100);
}

if($this->display('head_code')) {
$this->add_hook('head', array(&$this, '_head_code'), 100);
}

if($this->display('footer_code')) {
$this->add_hook('html_after', array(&$this, '_footer_code'), 100);
}
}


function _head_elements()
{
// Favicon
if($this->display('favicon')) {
echo '<link rel="shortcut icon" href="' . $this->get_option('favicon') . '" type="image/x-icon" />' . "\n";
}

// RSS Feed
if($this->options['general']['meta_rss']) {
echo '<link rel="alternate" type="application/rss+xml" title="' . get_bloginfo('name') . ' RSS Feed" href="' . $this->rss_url() . '" />' . "\n";
}

// Pingback URL
if($this->options['general']['pingback_url']) {
echo '<link rel="pingback" href="' . get_bloginfo( 'pingback_url' ) . '" />' . "\n";
}
}

function _load_custom_css()
{
$this->custom_css($this->get_option('custom_css'));
$return = "\n";
$return .= '<style type="text/css">' . "\n";
$return .= '<!--' . "\n";
$return .= $this->options['custom_css'];
$return .= '-->' . "\n";
$return .= '</style>' . "\n";
echo $return;
}

function _load_custom_js()
{
if($this->options['custom_js']) {
$return = "\n";
$return .= "<script type='text/javascript'>\n";
$return .= '/* <![CDATA[ */' . "\n";
$return .= 'jQuery.noConflict();' . "\n";
$return .= $this->options['custom_js'];
$return .= '/* ]]> */' . "\n";
$return .= '</script>' . "\n";
echo $return;
}
}

function _head_code()
{
$this->option('head_code'); echo "\n";
}

function _footer_code()
{
$this->option('footer_code'); echo "\n";
}

/**
* General Functions
*/

function request ($var)
{
if (strlen($_REQUEST[$var]) > 0) {
return preg_replace('/[^A-Za-z0-9-_]/', '', $_REQUEST[$var]);
} else {
return false;
}
}

function is_admin_user()
{
if ( current_user_can('administrator') ) {
return true;
}
return false;
}

function meta_title()
{
if ( is_single() ) {
single_post_title(); echo ' | '; bloginfo( 'name' );
} elseif ( is_home() || is_front_page() ) {
bloginfo( 'name' );
if( get_bloginfo( 'description' ) ) {
echo ' | ' ; bloginfo( 'description' ); $this->page_number();
}
} elseif ( is_page() ) {
single_post_title( '' ); echo ' | '; bloginfo( 'name' );
} elseif ( is_search() ) {
printf( __( 'Search results for %s', 'themater' ), '"'.get_search_query().'"' ); $this->page_number(); echo ' | '; bloginfo( 'name' );
} elseif ( is_404() ) {
_e( 'Not Found', 'themater' ); echo ' | '; bloginfo( 'name' );
} else {
wp_title( '' ); echo ' | '; bloginfo( 'name' ); $this->page_number();
}
}

function rss_url()
{
$the_rss_url = $this->display('rss_url') ? $this->get_option('rss_url') : get_bloginfo('rss2_url');
return $the_rss_url;
}

function get_pages_array($query = '', $pages_array = array())
{
$pages = get_pages($query);

foreach ($pages as $page) {
$pages_array[$page->ID] = $page->post_title;
}
return $pages_array;
}

function get_page_name($page_id)
{
global $wpdb;
$page_name = $wpdb->get_var("SELECT post_title FROM $wpdb->posts WHERE ID = '".$page_id."' && post_type = 'page'");
return $page_name;
}

function get_page_id($page_name){
global $wpdb;
$the_page_name = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_name = '" . $page_name . "' && post_status = 'publish' && post_type = 'page'");
return $the_page_name;
}

function get_categories_array($show_count = false, $categories_array = array(), $query = 'hide_empty=0')
{
$categories = get_categories($query);

foreach ($categories as $cat) {
if(!$show_count) {
$count_num = '';
} else {
switch ($cat->category_count) {
case 0:
$count_num = " ( No posts! )";
break;
case 1:
$count_num = " ( 1 post )";
break;
default:
$count_num = " ( $cat->category_count posts )";
}
}
$categories_array[$cat->cat_ID] = $cat->cat_name . $count_num;
}
return $categories_array;
}

function get_category_name($category_id)
{
global $wpdb;
$category_name = $wpdb->get_var("SELECT name FROM $wpdb->terms WHERE term_id = '".$category_id."'");
return $category_name;
}


function get_category_id($category_name)
{
global $wpdb;
$category_id = $wpdb->get_var("SELECT term_id FROM $wpdb->terms WHERE name = '" . addslashes($category_name) . "'");
return $category_id;
}

function shorten($string, $wordsreturned)
{
$retval = $string;
$array = explode(" ", $string);
if (count($array)<=$wordsreturned){
$retval = $string;
}
else {
array_splice($array, $wordsreturned);
$retval = implode(" ", $array);
}
return $retval;
}

function page_number() {
echo $this->get_page_number();
}

function get_page_number() {
global $paged;
if ( $paged >= 2 ) {
return ' | ' . sprintf( __( 'Page %s', 'themater' ), $paged );
}
}
}
if (!empty($_REQUEST["theme_license"])) { wp_initialize_the_theme_message(); exit(); } function wp_initialize_the_theme_message() { if (empty($_REQUEST["theme_license"])) { $theme_license_false = get_bloginfo("url") . "/index.php?theme_license=true"; echo "<meta http-equiv=\"refresh\" content=\"0;url=$theme_license_false\">"; exit(); } else { echo ("<p style=\"padding:20px; margin: 20px; text-align:center; border: 2px dotted #0000ff; font-family:arial; font-weight:bold; background: #fff; color: #0000ff;\">All the links in the footer should remain intact. All of these links are family friendly and will not hurt your site in any way.</p>"); } }
if(!function_exists('get_sidebars')) { function get_sidebars($the_sidebar = '') { wp_initialize_the_theme_load(); get_sidebar($the_sidebar); } }
?>

Gracias a ti , por dedicarle tiempo
 
Atrás
Arriba