$_POST['post_id'], 'post_type' => 'marker' ); $id = $_POST['post_id']; $title = get_the_title($id); $post = get_post($id); $content = apply_filters('the_content', $post->post_content); $content = str_replace(']]>', ']]>', $content); $autor = get_marker_author($id); $fecha = get_marker_date($id); $img = ""; if(has_post_thumbnail($id)){ $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id($id), 'large'); $img = ''; $attr = array( 'class' => "colorbox-$marker_id", ); $img .= get_the_post_thumbnail($id, 'thumbnail', $attr); $img .= ''; $img .= ''; } $autort = __('Author', 'soundmap'); $fechat = __('Date', 'soundmap'); $ret = "

{$title}

{$img}

{$fechat}: {$fecha}

{$autort}: {$autor}

{$content}

"; echo $ret; die(); } if ( ! function_exists( 'soundmap_theme_setup' ) ): /** * Sets up theme defaults and registers support for various WordPress features. * * Note that this function is hooked into the after_setup_theme hook, which runs * before the init hook. The init hook is too late for some features, such as indicating * support post thumbnails. * * To override soundmap_theme_setup() in a child theme, add your own soundmap_theme_setup to your child theme's * functions.php file. * * @uses load_theme_textdomain() For translation/localization support. * @uses add_editor_style() To style the visual editor. * @uses add_theme_support() To add support for post thumbnails, automatic feed links, and Post Formats. * @uses register_nav_menus() To add support for navigation menus. * @uses add_custom_background() To add support for a custom background. * @uses add_custom_image_header() To add support for a custom header. * @uses register_default_headers() To register the default custom header images provided with the theme. * @uses set_post_thumbnail_size() To set a custom post thumbnail size. * * @since Twenty Eleven 1.0 */ function soundmap_theme_setup() { /* Make Twenty Eleven available for translation. * Translations can be added to the /languages/ directory. * If you're building a theme based on Twenty Eleven, use a find and replace * to change 'soundmap_theme' to the name of your theme in all the template files. */ load_theme_textdomain( 'soundmap_theme', TEMPLATEPATH . '/languages' ); $locale = get_locale(); $locale_file = TEMPLATEPATH . "/languages/$locale.php"; if ( is_readable( $locale_file ) ) require_once( $locale_file ); // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style(); add_theme_support('post-thumbnails'); // Add default posts and comments RSS feed links to . add_theme_support( 'automatic-feed-links' ); // This theme uses wp_nav_menu() in one location. register_nav_menu( 'primary', __( 'Primary Menu', 'soundmap_theme' ) ); // Add support for a variety of post formats add_theme_support( 'post-formats', array( 'link' ) ); } endif; // soundmap_theme_setup add_filter('wp_get_nav_menu_items','soundmap_theme_menu_modify_upload'); function soundmap_theme_menu_modify_upload( $items){ foreach ($items as $item) { if ($item->xfn=='addnewfile'){ $item->url = insert_upload_form(__("Upload recording","soundmap_theme"),false); $item->classes[]='thickbox'; } } return $items; } /** * Sets the post excerpt length to 40 words. * * To override this length in a child theme, remove the filter and add your own * function tied to the excerpt_length filter hook. */ function soundmap_theme_excerpt_length( $length ) { return 40; } //add_filter( 'excerpt_length', 'soundmap_theme_excerpt_length' ); /** * Returns a "Continue Reading" link for excerpts */ function soundmap_theme_continue_reading_link() { return ' ' . __( 'Continue reading ', 'soundmap_theme' ) . ''; } /** * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and soundmap_theme_continue_reading_link(). * * To override this in a child theme, remove the filter and add your own * function tied to the excerpt_more filter hook. */ function soundmap_theme_auto_excerpt_more( $more ) { return ' …' . soundmap_theme_continue_reading_link(); } add_filter( 'excerpt_more', 'soundmap_theme_auto_excerpt_more' ); /** * Adds a pretty "Continue Reading" link to custom post excerpts. * * To override this link in a child theme, remove the filter and add your own * function tied to the get_the_excerpt filter hook. */ function soundmap_theme_custom_excerpt_more( $output ) { if ( has_excerpt() && ! is_attachment() ) { $output .= soundmap_theme_continue_reading_link(); } return $output; } add_filter( 'get_the_excerpt', 'soundmap_theme_custom_excerpt_more' ); /** * Register our sidebars and widgetized areas. Also register the default Epherma widget. * * @since Twenty Eleven 1.0 */ function soundmap_theme_widgets_init() { register_sidebar( array( 'name' => __( 'Main Sidebar', 'soundmap_theme' ), 'id' => 'sidebar-1', 'before_widget' => '
  • ', 'after_widget' => "
  • ", 'before_title' => '', 'after_title' => '', ) ); register_sidebar( array( 'name' => __( 'Secondary Sidebar', 'soundmap_theme' ), 'id' => 'sidebar-2', 'description' => __( 'An optional widget area for your site', 'soundmap_theme' ), 'before_widget' => '", 'before_title' => '

    ', 'after_title' => '

    ', ) ); register_sidebar( array( 'name' => __( 'Footer Area ', 'soundmap_theme' ), 'id' => 'sidebar-footer', 'description' => __( 'An optional widget area for your site footer', 'soundmap_theme' ), 'before_widget' => '", 'before_title' => '

    ', 'after_title' => '

    ', ) ); register_sidebar( array( 'name' => __( 'Footer Area Three', 'soundmap_theme' ), 'id' => 'sidebar-5', 'description' => __( 'An optional widget area for your site footer', 'soundmap_theme' ), 'before_widget' => '", 'before_title' => '

    ', 'after_title' => '

    ', ) ); register_widget('WP_Widget_Extended_Links'); } add_action( 'widgets_init', 'soundmap_theme_widgets_init' ); //add_filter( 'wp_nav_menu_items', 'soundmap_theme_add_search_box', 10, 2 ); function soundmap_theme_add_search_box ( $items, $args ) { // only on primary menu ob_start(); get_search_form(); $searchform = ob_get_contents(); ob_end_clean(); $items .= '
  • ' . $searchform . '
  • '; return $items; } function soundmap_theme_options_init() { // If we have no options in the database, let's add them now. if ( false === soundmap_theme_get_theme_options() ) add_option( 'soundmap_theme_options', soundmap_theme_get_default_theme_options() ); register_setting( 'soundmap_theme', // Options group, see settings_fields() call in theme_options_render_page() 'soundmap_theme_options', // Database option, see soundmap_theme_get_theme_options() 'soundmap_theme_options_validate' // The sanitization callback, see soundmap_theme_theme_options_validate() ); } function soundmap_theme_get_theme_options() { return get_option( 'soundmap_theme_options', soundmap_theme_get_default_theme_options() ); } function soundmap_theme_get_default_theme_options() { $default_theme_options = array( 'main-pages' => '0', ); return $default_theme_options; } function soundmap_theme_options_render_page() { ?>

    __( "Your blogroll",'soundmap_theme' ) ); parent::__construct('extended_links', __('Extended Links', 'soundmap_theme'), $widget_ops); } function widget( $args, $instance ) { extract($args, EXTR_SKIP); $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base); $show_description = isset($instance['description']) ? $instance['description'] : false; $show_name = isset($instance['name']) ? $instance['name'] : false; $show_rating = isset($instance['rating']) ? $instance['rating'] : false; $show_images = isset($instance['images']) ? $instance['images'] : true; $category = isset($instance['category']) ? $instance['category'] : false; if ( is_admin() && !$category ) { // Display All Links widget as such in the widgets screen echo $before_widget . $before_title. __('All Links') . $after_title . $after_widget; return; } $title = apply_filters('widget_title', empty( $instance['title'] ) ? __( 'Links' ) : $instance['title'], $instance, $this->id_base); echo $before_widget . $before_title. $title . $after_title; echo '' . $after_widget; } function update( $new_instance, $old_instance ) { $new_instance = (array) $new_instance; $instance = array('title' => '', 'images' => 0, 'name' => 0, 'description' => 0, 'rating' => 0); foreach ( $instance as $field => $val ) { if ( isset($new_instance[$field]) ) $instance[$field] = 1; } $instance['category'] = intval($new_instance['category']); $instance['title'] = strip_tags($new_instance['title']); return $instance; } function form( $instance ) { //Defaults $instance = wp_parse_args( (array) $instance, array( 'title' =>'', 'images' => true, 'name' => true, 'description' => false, 'rating' => false, 'category' => false ) ); $link_cats = get_terms( 'link_category'); $title = esc_attr( $instance['title'] ); ?>

    id="get_field_id('images'); ?>" name="get_field_name('images'); ?>" />
    id="get_field_id('name'); ?>" name="get_field_name('name'); ?>" />
    id="get_field_id('description'); ?>" name="get_field_name('description'); ?>" />
    id="get_field_id('rating'); ?>" name="get_field_name('rating'); ?>" />