C
coolhansel
Curioso
¡Usuario con pocos negocios! ¡Utiliza siempre saldo de Forobeta!
alguien sabe como puedo quitar el rss que tengo en mi tema de wp? pongo el functions.php aver si me podeis decir como hacerlo.
ahora se publican noticias de otra pagina en la mia, y quiero quitarlo.
[SUB]<?php
$new_meta_boxes =
array(
"image" => array(
"name" => "image",
"std" => "",
"title" => "Imagen miniatura",
"description" => "Escribe la URL de la imagen que quieres poner de miniatura")
);
function new_meta_boxes() {
global $post, $new_meta_boxes;
foreach($new_meta_boxes as $meta_box) {
$meta_box_value = get_post_meta($post->ID, $meta_box['name'].'_value', true);
if($meta_box_value == "")
$meta_box_value = $meta_box['std'];
echo'<input type="hidden" name="'.$meta_box['name'].'_noncename" id="'.$meta_box['name'].'_noncename" value="'.wp_create_nonce( plugin_basename(__FILE__) ).'" />';
echo'<h2>'.$meta_box['title'].'</h2>';
echo'<input type="text" name="'.$meta_box['name'].'_value" value="'.$meta_box_value.'" size="55" /><br />';
echo'<p><label for="'.$meta_box['name'].'_value">'.$meta_box['description'].'</label></p>';
}
}
function create_meta_box() {
global $theme_name;
if ( function_exists('add_meta_box') ) {
add_meta_box( 'new-meta-boxes', 'Thumbnail', 'new_meta_boxes', 'post', 'normal', 'high' );
}
}
function save_postdata( $post_id ) {
global $post, $new_meta_boxes;
foreach($new_meta_boxes as $meta_box) {
// Verify
if ( !wp_verify_nonce( $_POST[$meta_box['name'].'_noncename'], plugin_basename(__FILE__) )) {
return $post_id;
}
if ( 'page' == $_POST['post_type'] ) {
if ( !current_user_can( 'edit_page', $post_id ))
return $post_id;
} else {
if ( !current_user_can( 'edit_post', $post_id ))
return $post_id;
}
$data = $_POST[$meta_box['name'].'_value'];
if(get_post_meta($post_id, $meta_box['name'].'_value') == "")
add_post_meta($post_id, $meta_box['name'].'_value', $data, true);
elseif($data != get_post_meta($post_id, $meta_box['name'].'_value', true))
update_post_meta($post_id, $meta_box['name'].'_value', $data);
elseif($data == "")
delete_post_meta($post_id, $meta_box['name'].'_value', get_post_meta($post_id, $meta_box['name'].'_value', true));
}
}
add_action('admin_menu', 'create_meta_box');
add_action('save_post', 'save_postdata');
function acortar($string, $limit, $break, $pad) {
// return with no change if string is shorter than $limit
if(strlen($string) <= $limit)
return $string;
// is $break present between $limit and the end of the string?
if(false !== ($breakpoint = strpos($string, $break, $limit))) {
$longitud=strlen($string)-1;
if($breakpoint < $longitud) {
$string = substr($string, 0, $breakpoint) . $pad;
}
}
return $string;
}
function formato($fecha)
{
//Año-Mes-Dia Hora:Minuto:Segundo
$f=explode("-",$fecha);//explode me divide fecha en Año, Mes y Dia Hora:Minuto:Segundo donde Año es el indice 0, Mes el indice 1 y Dia Hora:Minuto:Segundo el indice 2
$dia=explode(" ",$f[2]);//Obtengo Dia y Hora:Minuto:Segundo donde Dia es indice 0 y Hora:Minuto:Segundo el indice 2
$fecha=$dia[0]."/".$f[1]."/".$f[0]." ".$dia[1];
echo "<span>".$fecha."</span>";
}
function get_page_content($url){
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
$page = curl_exec($ch);
curl_close($ch);
return $page;
}
function the_content_limit($max_char, $more_link_text = '(more...)', $stripteaser = 0, $more_file = '') {
$content = get_the_content($more_link_text, $stripteaser, $more_file);
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
$content = strip_tags($content);
if (strlen($_GET['p']) > 0) {
echo "<div>";
echo $content;
echo "</div>";
}
else if ((strlen($content)>$max_char) && ($espacio = strpos($content, " ", $max_char ))) {
$content = substr($content, 0, $espacio);
$content = $content;
echo "<div>";
echo $content;
echo "...";
echo "</div>";
}
else {
echo "<div>";
echo $content;
echo "</div>";
}
}
?>[/SUB]
ahora se publican noticias de otra pagina en la mia, y quiero quitarlo.
[SUB]<?php
$new_meta_boxes =
array(
"image" => array(
"name" => "image",
"std" => "",
"title" => "Imagen miniatura",
"description" => "Escribe la URL de la imagen que quieres poner de miniatura")
);
function new_meta_boxes() {
global $post, $new_meta_boxes;
foreach($new_meta_boxes as $meta_box) {
$meta_box_value = get_post_meta($post->ID, $meta_box['name'].'_value', true);
if($meta_box_value == "")
$meta_box_value = $meta_box['std'];
echo'<input type="hidden" name="'.$meta_box['name'].'_noncename" id="'.$meta_box['name'].'_noncename" value="'.wp_create_nonce( plugin_basename(__FILE__) ).'" />';
echo'<h2>'.$meta_box['title'].'</h2>';
echo'<input type="text" name="'.$meta_box['name'].'_value" value="'.$meta_box_value.'" size="55" /><br />';
echo'<p><label for="'.$meta_box['name'].'_value">'.$meta_box['description'].'</label></p>';
}
}
function create_meta_box() {
global $theme_name;
if ( function_exists('add_meta_box') ) {
add_meta_box( 'new-meta-boxes', 'Thumbnail', 'new_meta_boxes', 'post', 'normal', 'high' );
}
}
function save_postdata( $post_id ) {
global $post, $new_meta_boxes;
foreach($new_meta_boxes as $meta_box) {
// Verify
if ( !wp_verify_nonce( $_POST[$meta_box['name'].'_noncename'], plugin_basename(__FILE__) )) {
return $post_id;
}
if ( 'page' == $_POST['post_type'] ) {
if ( !current_user_can( 'edit_page', $post_id ))
return $post_id;
} else {
if ( !current_user_can( 'edit_post', $post_id ))
return $post_id;
}
$data = $_POST[$meta_box['name'].'_value'];
if(get_post_meta($post_id, $meta_box['name'].'_value') == "")
add_post_meta($post_id, $meta_box['name'].'_value', $data, true);
elseif($data != get_post_meta($post_id, $meta_box['name'].'_value', true))
update_post_meta($post_id, $meta_box['name'].'_value', $data);
elseif($data == "")
delete_post_meta($post_id, $meta_box['name'].'_value', get_post_meta($post_id, $meta_box['name'].'_value', true));
}
}
add_action('admin_menu', 'create_meta_box');
add_action('save_post', 'save_postdata');
function acortar($string, $limit, $break, $pad) {
// return with no change if string is shorter than $limit
if(strlen($string) <= $limit)
return $string;
// is $break present between $limit and the end of the string?
if(false !== ($breakpoint = strpos($string, $break, $limit))) {
$longitud=strlen($string)-1;
if($breakpoint < $longitud) {
$string = substr($string, 0, $breakpoint) . $pad;
}
}
return $string;
}
function formato($fecha)
{
//Año-Mes-Dia Hora:Minuto:Segundo
$f=explode("-",$fecha);//explode me divide fecha en Año, Mes y Dia Hora:Minuto:Segundo donde Año es el indice 0, Mes el indice 1 y Dia Hora:Minuto:Segundo el indice 2
$dia=explode(" ",$f[2]);//Obtengo Dia y Hora:Minuto:Segundo donde Dia es indice 0 y Hora:Minuto:Segundo el indice 2
$fecha=$dia[0]."/".$f[1]."/".$f[0]." ".$dia[1];
echo "<span>".$fecha."</span>";
}
function get_page_content($url){
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
$page = curl_exec($ch);
curl_close($ch);
return $page;
}
function the_content_limit($max_char, $more_link_text = '(more...)', $stripteaser = 0, $more_file = '') {
$content = get_the_content($more_link_text, $stripteaser, $more_file);
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
$content = strip_tags($content);
if (strlen($_GET['p']) > 0) {
echo "<div>";
echo $content;
echo "</div>";
}
else if ((strlen($content)>$max_char) && ($espacio = strpos($content, " ", $max_char ))) {
$content = substr($content, 0, $espacio);
$content = $content;
echo "<div>";
echo $content;
echo "...";
echo "</div>";
}
else {
echo "<div>";
echo $content;
echo "</div>";
}
}
?>[/SUB]