Foros del Web » Creando para Internet » Sistemas de gestión de contenidos » WordPress »

Campos personalizados desde páginas.

Estas en el tema de Campos personalizados desde páginas. en el foro de WordPress en Foros del Web. Hola gente! Estoy trabajando en un sitio con el theme webfolio El mismo cuenta con un slider en la página principal, que funciona mediante campos ...
  #1 (permalink)  
Antiguo 25/04/2011, 16:11
Avatar de pao01
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 1.875
Antigüedad: 15 años, 10 meses
Puntos: 351
Campos personalizados desde páginas.

Hola gente!

Estoy trabajando en un sitio con el theme webfolio

El mismo cuenta con un slider en la página principal, que funciona mediante campos personalizados. (Aquí muestra cómo hacer el setup)

Hasta aquí todo funciona fantástico

Mi consulta es la siguiente:
yo deseo que el slider muestre contenido de páginas y no de post. De hecho cuando yo creo una nueva página tengo la opción de los campos personalizados pero por más que los cargue no los muestra en el slider.

¿Habrá alguna forma de modificarlo? Muchas Gracias.
__________________
Entre más estrecha la mente, más grande la boca.- Ted Cook
Autosconarte-Blog
  #2 (permalink)  
Antiguo 25/04/2011, 16:37
Avatar de zanguanga
Moderadora
 
Fecha de Ingreso: julio-2009
Ubicación: España
Mensajes: 1.686
Antigüedad: 14 años, 9 meses
Puntos: 429
Respuesta: Campos personalizados desde páginas.

En primer lugar yo desactivaría todos los plugins, para descartar alguna incompatibilidad.

Si no existe incompatibilidad, supongo que tendrás que localizar y abrir el archivo .js del slider o de la plantilla correspondiente desde donde se haga la llamada a ver si ahí puedes modificar algo, functions.php home.php, index.php, etc.
__________________
Mi blog personal | Mi G+
  #3 (permalink)  
Antiguo 25/04/2011, 17:09
Avatar de pao01
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 1.875
Antigüedad: 15 años, 10 meses
Puntos: 351
Respuesta: Campos personalizados desde páginas.

Gracias Zanguanga por la respuesta.

Te cuento, desactivé uno a uno los plugins y no hay cambios.

Subo los códigos del home y del js del slide, a ver si alguien puede orientarme, porque no doy con ello. Muchas Gracias.

Código PHP:
Ver original
  1. <?php get_header(); ?>
  2.  
  3. <!-- begin slider -->
  4.     <!-- begin slider -->
  5.             <div id="slider" >
  6.                     <div class="stepcarousel">
  7.                         <div class="belt">
  8.                         <?php
  9.                         $slider_query = new WP_Query($query_string.'&posts_per_page=-1');
  10.                         if ($slider_query -> have_posts()) : while ($slider_query -> have_posts()) : $slider_query -> the_post();
  11.                         $featured = get_post_meta($post->ID, 'featured', $single = true);
  12.                         $featured_image = get_post_meta($post->ID, 'featured_image', $single = true);
  13.                         if($featured =='1'){?>
  14.                             <!-- slider item -->
  15.                             <div class="panel">
  16.                             <div class="image"><a href="<?php the_permalink(); ?>"><img src="<?php echo $featured_image ?>" border="0" alt="<?php the_title(); ?>" /></a></div>
  17.                                 <div class="right">
  18.                                     <div class="text">
  19.                                         <div class="featured"><img src="<?php bloginfo('template_url'); ?>/images/ico_star.png" alt="Featured" /> FEATURED PROJECT</div>
  20.                                         <h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
  21.                                         <?php the_excerpt(); ?>
  22.                                     </div>
  23.                                 </div>
  24.                             </div>
  25.                             <?php } ?>
  26.                     <?php endwhile; ?>
  27.                     <?php endif; ?>
  28.                         </div>
  29.                     </div>
  30.             </div>
  31.             <!-- end slider -->
  32.     <!-- begin home boxes -->
  33.     <?php $box1=get_post(get_option('webfolio_home_box1'));
  34.               $box2=get_post(get_option('webfolio_home_box2'));
  35.               $box3=get_post(get_option('webfolio_home_box3'));
  36.               if(get_option('webfolio_home_box1')!= null && get_option('webfolio_home_box2')!= null && get_option('webfolio_home_box3')!= null){?>
  37.     <div id="homeBoxes" class="clearfix">
  38.         <div class="homeBox">
  39.             <h2><?php echo $box1->post_title?></h2>
  40.             <?php echo apply_filters('the_content', $box1->post_content);?>
  41.             <a href="<?php echo get_option('webfolio_home_box1_link')?>" class="more-link">read more</a>
  42.         </div>
  43.         <div class="homeBox">
  44.             <h2><?php echo $box2->post_title?></h2>
  45.             <?php echo apply_filters('the_content', $box2->post_content);?>
  46.             <a href="<?php echo get_option('webfolio_home_box2_link')?>" class="more-link">read more</a>
  47.         </div>
  48.         <div class="homeBox last">
  49.             <h2><?php echo $box3->post_title?></h2>
  50.             <?php echo apply_filters('the_content', $box3->post_content);?>
  51.             <a href="<?php echo get_option('webfolio_home_box3_link')?>" class="more-link">read more</a>
  52.         </div>
  53.     </div>
  54.     <?php }?>
  55.     <!-- end home boxes -->
  56.  
  57.  
  58. <!-- slider setup -->
  59. <script type="text/javascript">
  60.             stepcarousel.setup({
  61.                 galleryid: 'slider', //id of carousel DIV
  62.                 beltclass: 'belt', //class of inner "belt" DIV containing all the panel DIVs
  63.                 panelclass: 'panel', //class of panel DIVs each holding content
  64.                 autostep: {enable:true, moveby:1, pause:5000},
  65.                 panelbehavior: {speed:500, wraparound:false, persist:true},
  66.                 defaultbuttons: {enable: true, moveby: 1, leftnav: ['<?php bloginfo('template_directory'); ?>/images/but_prev.png', 653, 300], rightnav: ['<?php bloginfo('template_directory'); ?>/images/but_next.png', -170, 300]},
  67.                 statusvars: ['statusA', 'statusB', 'statusC'], //register 3 variables that contain current panel (start), current panel (last), and total panels
  68.                 contenttype: ['inline'] //content setting ['inline'] or ['external', 'path_to_external_file']
  69.             })
  70.            
  71.             </script>
  72.  
  73. <?php get_footer(); ?>
__________________
Entre más estrecha la mente, más grande la boca.- Ted Cook
Autosconarte-Blog
  #4 (permalink)  
Antiguo 25/04/2011, 17:11
Avatar de pao01
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 1.875
Antigüedad: 15 años, 10 meses
Puntos: 351
Respuesta: Campos personalizados desde páginas.

Código Javascript:
Ver original
  1. //Step Carousel Viewer: By Dynamic Drive, at http://www.dynamicdrive.com
  2. //** Created: March 19th, 08'
  3. //** Aug 16th, 08'- Updated to v 1.4:
  4.     //1) Adds ability to set speed/duration of panel animation (in milliseconds)
  5.     //2) Adds persistence support, so the last viewed panel is recalled when viewer returns within same browser session
  6.     //3) Adds ability to specify whether panels should stop at the very last and first panel, or wrap around and start all over again
  7.     //4) Adds option to specify two navigational image links positioned to the left and right of the Carousel Viewer to move the panels back and forth
  8.  
  9. //** Aug 27th, 08'- Nav buttons (if enabled) also repositions themselves now if window is resized
  10.  
  11. //** Sept 23rd, 08'- Updated to v 1.6:
  12.     //1) Carousel now stops at the very last visible panel, instead of the last panel itself. In other words, no more white space at the end.
  13.     //2) Adds ability for Carousel to auto rotate dictated by the new parameter: autostep: {enable:true, moveby:1, pause:3000}
  14.     //2i) During Auto Rotate, Carousel pauses onMouseover, resumes onMouseout. Clicking Carousel halts auto rotate.
  15.  
  16. //** Oct 22nd, 08'- Updated to v 1.6.1, which fixes functions stepBy() and stepTo() not stopping auto stepping of Carousel when called.
  17.  
  18. var stepcarousel={
  19.     ajaxloadingmsg: '<div style="margin: 1em; font-weight: bold"><img src="ajaxloadr.gif" style="vertical-align: middle" /> Fetching Content. Please wait...</div>', //customize HTML to show while fetching Ajax content
  20.     defaultbuttonsfade: 0.4, //Fade degree for disabled nav buttons (0=completely transparent, 1=completely opaque)
  21.     configholder: {},
  22.  
  23.     getCSSValue:function(val){ //Returns either 0 (if val contains 'auto') or val as an integer
  24.         return (val=="auto")? 0 : parseInt(val)
  25.     },
  26.  
  27.     getremotepanels:function($, config){ //function to fetch external page containing the panel DIVs
  28.         config.$belt.html(this.ajaxloadingmsg)
  29.         $.ajax({
  30.             url: config.contenttype[1], //path to external content
  31.             async: true,
  32.             error:function(ajaxrequest){
  33.                 config.$belt.html('Error fetching content.<br />Server Response: '+ajaxrequest.responseText)
  34.             },
  35.             success:function(content){
  36.                 config.$belt.html(content)
  37.                 config.$panels=config.$gallery.find('.'+config.panelclass)
  38.                 stepcarousel.alignpanels($, config)
  39.             }
  40.         })
  41.     },
  42.  
  43.     getoffset:function(what, offsettype){
  44.         return (what.offsetParent)? what[offsettype]+this.getoffset(what.offsetParent, offsettype) : what[offsettype]
  45.     },
  46.  
  47.     getCookie:function(Name){
  48.         var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
  49.         if (document.cookie.match(re)) //if cookie found
  50.             return document.cookie.match(re)[0].split("=")[1] //return its value
  51.         return null
  52.     },
  53.  
  54.     setCookie:function(name, value){
  55.         document.cookie = name+"="+value
  56.     },
  57.  
  58.     fadebuttons:function(config, currentpanel){
  59.         config.$leftnavbutton.fadeTo('fast', currentpanel==0? this.defaultbuttonsfade : 1)
  60.         config.$rightnavbutton.fadeTo('fast', currentpanel==config.lastvisiblepanel? this.defaultbuttonsfade : 1)
  61.     },
  62.  
  63.     addnavbuttons:function(config, currentpanel){
  64.         config.$leftnavbutton=$('<img src="'+config.defaultbuttons.leftnav[0]+'">').css({zIndex:50, position:'absolute', left:config.offsets.left+config.defaultbuttons.leftnav[1]+'px', top:config.offsets.top+config.defaultbuttons.leftnav[2]+'px', cursor:'hand', cursor:'pointer'}).attr({title:'Previous project '}).appendTo('body')
  65.         config.$rightnavbutton=$('<img src="'+config.defaultbuttons.rightnav[0]+'">').css({zIndex:50, position:'absolute', left:config.offsets.left+config.$gallery.get(0).offsetWidth+config.defaultbuttons.rightnav[1]+'px', top:config.offsets.top+config.defaultbuttons.rightnav[2]+'px', cursor:'hand', cursor:'pointer'}).attr({title:'Next project'}).appendTo('body')
  66.         config.$leftnavbutton.bind('click', function(){ //assign nav button event handlers
  67.             stepcarousel.stepBy(config.galleryid, -config.defaultbuttons.moveby)
  68.         })
  69.         config.$rightnavbutton.bind('click', function(){ //assign nav button event handlers
  70.             stepcarousel.stepBy(config.galleryid, config.defaultbuttons.moveby)
  71.         })
  72.         if (config.panelbehavior.wraparound==false){ //if carousel viewer should stop at first or last panel (instead of wrap back or forth)
  73.             this.fadebuttons(config, currentpanel)
  74.         }
  75.         return config.$leftnavbutton.add(config.$rightnavbutton)
  76.     },
  77.  
  78.     stopautostep:function(config){
  79.         clearTimeout(config.steptimer)
  80.         clearTimeout(config.resumeautostep)
  81.     },
  82.  
  83.     alignpanels:function($, config){
  84.         var paneloffset=0
  85.         config.paneloffsets=[paneloffset] //array to store upper left offset of each panel (1st element=0)
  86.         config.panelwidths=[] //array to store widths of each panel
  87.         config.$panels.each(function(index){ //loop through panels
  88.             var $currentpanel=$(this)
  89.             $currentpanel.css({float: 'none', position: 'absolute', left: paneloffset+'px'}) //position panel
  90.             $currentpanel.bind('click', function(e){return config.onpanelclick(e.target)}) //bind onpanelclick() to onclick event
  91.             paneloffset+=stepcarousel.getCSSValue($currentpanel.css('marginRight')) + parseInt($currentpanel.get(0).offsetWidth || $currentpanel.css('width')) //calculate next panel offset
  92.             config.paneloffsets.push(paneloffset) //remember this offset
  93.             config.panelwidths.push(paneloffset-config.paneloffsets[config.paneloffsets.length-2]) //remember panel width
  94.         })
  95.         config.paneloffsets.pop() //delete last offset (redundant)
  96.         var addpanelwidths=0
  97.         var lastpanelindex=config.$panels.length-1
  98.         config.lastvisiblepanel=lastpanelindex
  99.         for (var i=config.$panels.length-1; i>=0; i--){
  100.             addpanelwidths+=(i==lastpanelindex? config.panelwidths[lastpanelindex] : config.paneloffsets[i+1]-config.paneloffsets[i])
  101.             if (config.gallerywidth>addpanelwidths){
  102.                 config.lastvisiblepanel=i //calculate index of panel that when in 1st position reveals the very last panel all at once based on gallery width
  103.             }
  104.         }
  105.         config.$belt.css({width: paneloffset+'px'}) //Set Belt DIV to total panels' widths
  106.         config.currentpanel=(config.panelbehavior.persist)? parseInt(this.getCookie(window[config.galleryid+"persist"])) : 0 //determine 1st panel to show by default
  107.         config.currentpanel=(typeof config.currentpanel=="number" && config.currentpanel<config.$panels.length)? config.currentpanel : 0
  108.         if (config.currentpanel!=0){
  109.             var endpoint=config.paneloffsets[config.currentpanel]+(config.currentpanel==0? 0 : config.beltoffset)
  110.             config.$belt.css({left: -endpoint+'px'})
  111.         }
  112.         if (config.defaultbuttons.enable==true){ //if enable default back/forth nav buttons
  113.             var $navbuttons=this.addnavbuttons(config, config.currentpanel)
  114.             $(window).bind("load resize", function(){ //refresh position of nav buttons when page loads/resizes, in case offsets weren't available document.oncontentload
  115.                 config.offsets={left:stepcarousel.getoffset(config.$gallery.get(0), "offsetLeft"), top:stepcarousel.getoffset(config.$gallery.get(0), "offsetTop")}
  116.                 config.$leftnavbutton.css({left:config.offsets.left+config.defaultbuttons.leftnav[1]+'px', top:config.offsets.top+config.defaultbuttons.leftnav[2]+'px'})
  117.                 config.$rightnavbutton.css({left:config.offsets.left+config.$gallery.get(0).offsetWidth+config.defaultbuttons.rightnav[1]+'px', top:config.offsets.top+config.defaultbuttons.rightnav[2]+'px'})
  118.             })
  119.         }
  120.         if (config.autostep && config.autostep.enable){ //enable auto stepping of Carousel?    
  121.             var $carouselparts=config.$gallery.add(typeof $navbuttons!="undefined"? $navbuttons : null)
  122.             $carouselparts.bind('click', function(){
  123.                 stepcarousel.stopautostep(config)
  124.                 config.autostep.status="stopped"
  125.             })
__________________
Entre más estrecha la mente, más grande la boca.- Ted Cook
Autosconarte-Blog
  #5 (permalink)  
Antiguo 25/04/2011, 17:12
Avatar de pao01
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 1.875
Antigüedad: 15 años, 10 meses
Puntos: 351
Respuesta: Campos personalizados desde páginas.

Continuación...

Código Javascript:
Ver original
  1. $carouselparts.hover(function(){ //onMouseover
  2.                 stepcarousel.stopautostep(config)
  3.                 config.autostep.hoverstate="over"
  4.             }, function(){ //onMouseout
  5.                 if (config.steptimer && config.autostep.hoverstate=="over" && config.autostep.status!="stopped"){
  6.                     config.resumeautostep=setTimeout(function(){
  7.                         stepcarousel.autorotate(config.galleryid)
  8.                         config.autostep.hoverstate="out"
  9.                     }, 1500)
  10.                 }
  11.             })
  12.             config.steptimer=setTimeout(function(){stepcarousel.autorotate(config.galleryid)}, config.autostep.pause) //automatically rotate Carousel Viewer
  13.         } //end enable auto stepping check
  14.         this.statusreport(config.galleryid)
  15.         config.oninit()
  16.         config.onslideaction(this)
  17.     },
  18.  
  19.     stepTo:function(galleryid, pindex){ /*User entered pindex starts at 1 for intuitiveness. Internally pindex still starts at 0 */
  20.         var config=stepcarousel.configholder[galleryid]
  21.         if (typeof config=="undefined"){
  22.             alert("There's an error with your set up of Carousel Viewer \""+galleryid+ "\"!")
  23.             return
  24.         }
  25.         stepcarousel.stopautostep(config)
  26.         var pindex=Math.min(pindex-1, config.paneloffsets.length-1)
  27.         var endpoint=config.paneloffsets[pindex]+(pindex==0? 0 : config.beltoffset)
  28.         if (config.panelbehavior.wraparound==false && config.defaultbuttons.enable==true){ //if carousel viewer should stop at first or last panel (instead of wrap back or forth)
  29.             this.fadebuttons(config, pindex)
  30.         }
  31.         config.$belt.animate({left: -endpoint+'px'}, config.panelbehavior.speed, function(){config.onslideaction(this)})
  32.         config.currentpanel=pindex
  33.         this.statusreport(galleryid)
  34.     },
  35.  
  36.     stepBy:function(galleryid, steps){ //isauto if defined indicates stepBy() is being called automatically
  37.         var config=stepcarousel.configholder[galleryid]
  38.         if (typeof config=="undefined"){
  39.             alert("There's an error with your set up of Carousel Viewer \""+galleryid+ "\"!")
  40.             return
  41.         }
  42.         stepcarousel.stopautostep(config)
  43.         var direction=(steps>0)? 'forward' : 'back' //If "steps" is negative, that means backwards
  44.         var pindex=config.currentpanel+steps //index of panel to stop at
  45.         if (config.panelbehavior.wraparound==false){ //if carousel viewer should stop at first or last panel (instead of wrap back or forth)
  46.             pindex=(direction=="back" && pindex<=0)? 0 : (direction=="forward")? Math.min(pindex, config.lastvisiblepanel) : pindex
  47.             if (config.defaultbuttons.enable==true){ //if default nav buttons are enabled, fade them in and out depending on if at start or end of carousel
  48.                 stepcarousel.fadebuttons(config, pindex)
  49.             }  
  50.         }
  51.         else{ //else, for normal stepBy behavior
  52.             if (pindex>config.lastvisiblepanel && direction=="forward"){
  53.                 //if destination pindex is greater than last visible panel, yet we're currently not at the end of the carousel yet
  54.                 pindex=(config.currentpanel<config.lastvisiblepanel)? config.lastvisiblepanel : 0
  55.             }
  56.             else if (pindex<0 && direction=="back"){
  57.                 //if destination pindex is less than 0, yet we're currently not at the beginning of the carousel yet
  58.                 pindex=(config.currentpanel>0)? 0 : config.lastvisiblepanel /*wrap around left*/
  59.             }
  60.         }
  61.         var endpoint=config.paneloffsets[pindex]+(pindex==0? 0 : config.beltoffset) //left distance for Belt DIV to travel to
  62.         if (pindex==0 && direction=='forward' || config.currentpanel==0 && direction=='back' && config.panelbehavior.wraparound==true){ //decide whether to apply "push pull" effect
  63.             config.$belt.animate({left: -config.paneloffsets[config.currentpanel]-(direction=='forward'? 100 : -30)+'px'}, 'normal', function(){
  64.                 config.$belt.animate({left: -endpoint+'px'}, config.panelbehavior.speed, function(){config.onslideaction(this)})
  65.             })
  66.         }
  67.         else
  68.             config.$belt.animate({left: -endpoint+'px'}, config.panelbehavior.speed, function(){config.onslideaction(this)})
  69.         config.currentpanel=pindex
  70.         this.statusreport(galleryid)
  71.     },
  72.  
  73.     autorotate:function(galleryid){
  74.         var config=stepcarousel.configholder[galleryid]
  75.         if (config.$gallery.attr('_ismouseover')!="yes"){
  76.             this.stepBy(galleryid, config.autostep.moveby)
  77.         }
  78.         config.steptimer=setTimeout(function(){stepcarousel.autorotate(galleryid)}, config.autostep.pause)
  79.     },
  80.  
  81.     statusreport:function(galleryid){
  82.         var config=stepcarousel.configholder[galleryid]
  83.         var startpoint=config.currentpanel //index of first visible panel
  84.         var visiblewidth=0
  85.         for (var endpoint=startpoint; endpoint<config.paneloffsets.length; endpoint++){ //index (endpoint) of last visible panel
  86.             visiblewidth+=config.panelwidths[endpoint]
  87.             if (visiblewidth>config.gallerywidth){
  88.                 break
  89.             }
  90.         }
  91.         startpoint+=1 //format startpoint for user friendiness
  92.         endpoint=(endpoint+1==startpoint)? startpoint : endpoint //If only one image visible on the screen and partially hidden, set endpoint to startpoint
  93.         var valuearray=[startpoint, endpoint, config.panelwidths.length]
  94.         for (var i=0; i<config.statusvars.length; i++){
  95.             window[config.statusvars[i]]=valuearray[i] //Define variable (with user specified name) and set to one of the status values
  96.             config.$statusobjs[i].text(valuearray[i]+" ") //Populate element on page with ID="user specified name" with one of the status values
  97.         }
  98.     },
  99.  
  100.     setup:function(config){
  101.         //Disable Step Gallery scrollbars ASAP dynamically (enabled for sake of users with JS disabled)
  102.         document.write('<style type="text/css">\n#'+config.galleryid+'{overflow: hidden;}\n</style>')
  103.         jQuery(document).ready(function($){
  104.             config.$gallery=$('#'+config.galleryid)
  105.             config.gallerywidth=config.$gallery.width()
  106.             config.offsets={left:stepcarousel.getoffset(config.$gallery.get(0), "offsetLeft"), top:stepcarousel.getoffset(config.$gallery.get(0), "offsetTop")}
  107.             config.$belt=config.$gallery.find('.'+config.beltclass) //Find Belt DIV that contains all the panels
  108.             config.$panels=config.$gallery.find('.'+config.panelclass) //Find Panel DIVs that each contain a slide
  109.             config.panelbehavior.wraparound=(config.autostep && config.autostep.enable)? true : config.panelbehavior.wraparound //if auto step enabled, set "wraparound" to true
  110.             config.onpanelclick=(typeof config.onpanelclick=="undefined")? function(target){} : config.onpanelclick //attach custom "onpanelclick" event handler
  111.             config.onslideaction=(typeof config.onslide=="undefined")? function(){} : function(beltobj){$(beltobj).stop(); config.onslide()} //attach custom "onslide" event handler
  112.             config.oninit=(typeof config.oninit=="undefined")? function(){} : config.oninit //attach custom "oninit" event handler
  113.             config.beltoffset=stepcarousel.getCSSValue(config.$belt.css('marginLeft')) //Find length of Belt DIV's left margin
  114.             config.statusvars=config.statusvars || []  //get variable names that will hold "start", "end", and "total" slides info
  115.             config.$statusobjs=[$('#'+config.statusvars[0]), $('#'+config.statusvars[1]), $('#'+config.statusvars[2])]
  116.             config.currentpanel=0
  117.             stepcarousel.configholder[config.galleryid]=config //store config parameter as a variable
  118.             if (config.contenttype[0]=="ajax" && typeof config.contenttype[1]!="undefined") //fetch ajax content?
  119.                 stepcarousel.getremotepanels($, config)
  120.             else
  121.                 stepcarousel.alignpanels($, config) //align panels and initialize gallery
  122.         }) //end document.ready
  123.         jQuery(window).bind('unload', function(){ //clean up
  124.             if (config.panelbehavior.persist){
  125.                 stepcarousel.setCookie(window[config.galleryid+"persist"], config.currentpanel)
  126.             }
  127.             jQuery.each(config, function(ai, oi){
  128.                 oi=null
  129.             })
  130.             config=null
  131.         })
  132.     }
  133. }
__________________
Entre más estrecha la mente, más grande la boca.- Ted Cook
Autosconarte-Blog
  #6 (permalink)  
Antiguo 25/04/2011, 17:39
Avatar de zanguanga
Moderadora
 
Fecha de Ingreso: julio-2009
Ubicación: España
Mensajes: 1.686
Antigüedad: 14 años, 9 meses
Puntos: 429
Respuesta: Campos personalizados desde páginas.

Me parece que con el archivo header.php es suficiente.

No sé si será una burrada lo que voy a decirte, pero ¿has probado a cambiar $single por $page a ver qué ocurre?

Código:
$single = true
por

Código:
$page = true
¡Suerte!
__________________
Mi blog personal | Mi G+
  #7 (permalink)  
Antiguo 25/04/2011, 18:28
Avatar de pao01
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 1.875
Antigüedad: 15 años, 10 meses
Puntos: 351
Respuesta: Campos personalizados desde páginas.

Gracias, pero no funcionó
__________________
Entre más estrecha la mente, más grande la boca.- Ted Cook
Autosconarte-Blog
  #8 (permalink)  
Antiguo 25/04/2011, 20:27
Avatar de carlos_belisario
Colaborador
 
Fecha de Ingreso: abril-2010
Ubicación: Venezuela Maracay Aragua
Mensajes: 3.156
Antigüedad: 14 años
Puntos: 461
Respuesta: Campos personalizados desde páginas.

Buenas pao01, no se si entendi bien pero si es como entendi pudieras indicarle a la clase WP_query que solo traiga paginas, asi como dice el codex aca , espero te sea de ayuda,
__________________
aprende d tus errores e incrementa tu conocimientos
it's not a bug, it's an undocumented feature By @David
php the right way
  #9 (permalink)  
Antiguo 25/04/2011, 21:24
Avatar de pao01
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 1.875
Antigüedad: 15 años, 10 meses
Puntos: 351
Respuesta: Campos personalizados desde páginas.

Gracias Carlos

Lo primero decir entre lo buscado por mi parte y lo que Zanguanga y tú me responden he llegado a la conclusión que el tema va en esta parte del código:

Código PHP:
Ver original
  1. <!-- begin slider -->
  2.             <div id="slider" >
  3.                     <div class="stepcarousel">
  4.                         <div class="belt">
  5.                         <?php
  6.                         $slider_query = new WP_Query($query_string.'&posts_per_page=-1');
  7.                         if ($slider_query -> have_posts()) : while ($slider_query -> have_posts()) : $slider_query -> the_post();
  8.                         $featured = get_post_meta($post->ID, 'featured', $single = true);
  9.                         $featured_image = get_post_meta($post->ID, 'featured_image', $single = true);
  10.                         if($featured =='1'){?>
  11.                             <!-- slider item -->
  12.                             <div class="panel">
  13.                             <div class="image"><a href="<?php the_permalink(); ?>"><img src="<?php echo $featured_image ?>" border="0" alt="<?php the_title(); ?>" /></a></div>
  14.                                 <div class="right">
  15.                                     <div class="text">
  16.                                         <div class="featured"><img src="<?php bloginfo('template_url'); ?>/images/ico_star.png" alt="Featured" /> FEATURED PROJECT</div>
  17.                                         <h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
  18.                                         <?php the_excerpt(); ?>
  19.                                     </div>
  20.                                 </div>
  21.                             </div>
  22.                             <?php } ?>
  23.                     <?php endwhile; ?>
  24.                     <?php endif; ?>
  25.                         </div>
  26.                     </div>
  27.             </div>
  28.             <!-- end slider -->

Ahora como soy una phpera "nula", vi lo que me enviaste y si bien creo que lo que me indicaste habría que implementarlo en la parte del código que cito, no se me ocurre cómo (independientemente del inglés que se dificulta otro tanto).

Si me pueden dar una manito más lo agradezco, no pretendo lo resuelvan, sino que me peguen el empujón nomás aunque sea para comprender como hacerlo.

Gracias de nuevo
__________________
Entre más estrecha la mente, más grande la boca.- Ted Cook
Autosconarte-Blog
  #10 (permalink)  
Antiguo 25/04/2011, 21:43
Avatar de carlos_belisario
Colaborador
 
Fecha de Ingreso: abril-2010
Ubicación: Venezuela Maracay Aragua
Mensajes: 3.156
Antigüedad: 14 años
Puntos: 461
Respuesta: Campos personalizados desde páginas.

bueno puse la referencia aunque te confiezo que la vi con el traductor de google , ahora a lo que segun yo entendi de tu problema es que en el $slider_query te trae los distintos post que tiene tu pagina segun veo, ahoraen la variable $query_string que consulta le pasas a WP_query?? según mi no muy experimentado trabajo con la clase WP_query segun entendi luego de releer el codex de esta funcion sino le pasas un parametro te trae los post y con el parametro que indicaste indica cuantos post por paginam entoces, como tu lo que deseas es que te de las paginas de tu web sencillamente indicale en un array que quieres obtener es las paginas
Código PHP:
Ver original
  1. $args = array(
  2.     'post_type' => 'page',
  3.     'posts_per_page' => -1
  4. );
  5. /* $slider_query = new WP_Query($query_string.'&posts_per_page=-1'); sustituimos esta linea por la que coloco abajo con los argumentos haz la prueba y nos comentas a ver si te funciono*/
  6.     $slider_query = new WP_Query( $args );
ahora verifica bien porque no entiendo el porque del -1, aunque en eso si debes de saber tu mucho mas que yo, saludos espero te ayude, saludos
__________________
aprende d tus errores e incrementa tu conocimientos
it's not a bug, it's an undocumented feature By @David
php the right way
  #11 (permalink)  
Antiguo 25/04/2011, 22:26
Avatar de pao01
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 1.875
Antigüedad: 15 años, 10 meses
Puntos: 351
Respuesta: Campos personalizados desde páginas.

En el reciente intento algo no funcionó, pero deja que lo vuelva a probar mañana, sin sueño; que seguramente pienso mejor. Gracias!
__________________
Entre más estrecha la mente, más grande la boca.- Ted Cook
Autosconarte-Blog
  #12 (permalink)  
Antiguo 26/04/2011, 19:59
Avatar de pao01
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 1.875
Antigüedad: 15 años, 10 meses
Puntos: 351
Respuesta: Campos personalizados desde páginas.

Carlos!!!!!!!

Funcionó

MUCHAS PERO MUCHAS GRACIAS. y un container entero de Karma para tí.

Quedó así, por si a alguien le resulta útil.

Código PHP:
Ver original
  1. <div class="stepcarousel">
  2.                         <div class="belt">
  3.                         <?php
  4.                         $args = array(
  5.                         'post_type' => 'page',
  6.                         'posts_per_page' => -1
  7.                             );
  8.                         $slider_query = new WP_Query($query_string.'&posts_per_page=-1');
  9.                         $slider_query = new WP_Query( $args );
  10.                         if ($slider_query -> have_posts()) : while ($slider_query -> have_posts()) : $slider_query -> the_post();
  11.                         $featured = get_post_meta($post->ID, 'featured', $single = true);
  12.                         $featured_image = get_post_meta($post->ID, 'featured_image', $single = true);
  13.                         if($featured =='1'){?>
  14.                        
  15.                             <!-- slider item -->
__________________
Entre más estrecha la mente, más grande la boca.- Ted Cook
Autosconarte-Blog
  #13 (permalink)  
Antiguo 26/04/2011, 20:27
Avatar de carlos_belisario
Colaborador
 
Fecha de Ingreso: abril-2010
Ubicación: Venezuela Maracay Aragua
Mensajes: 3.156
Antigüedad: 14 años
Puntos: 461
Respuesta: Campos personalizados desde páginas.

excelente pao01 me alegro que te halla funcionado pero una acotacion esta linea esta de mas
Código PHP:
Ver original
  1. $slider_query = new WP_Query($query_string.'&posts_per_page=-1');
ya que la sustituyes inmediatamente con la siguiente linea fijate
Código PHP:
Ver original
  1. $slider_query = new WP_Query($query_string.'&posts_per_page=-1');
  2. $slider_query = new WP_Query( $args );
saludos
__________________
aprende d tus errores e incrementa tu conocimientos
it's not a bug, it's an undocumented feature By @David
php the right way
  #14 (permalink)  
Antiguo 26/04/2011, 20:48
Avatar de pao01
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 1.875
Antigüedad: 15 años, 10 meses
Puntos: 351
Respuesta: Campos personalizados desde páginas.

Perfecto!, que suerte que lo viste y que suerte que aún con el error funcionaba sino todavía estaría dando vueltas.

GRACIAS!!!!
__________________
Entre más estrecha la mente, más grande la boca.- Ted Cook
Autosconarte-Blog
  #15 (permalink)  
Antiguo 26/04/2011, 21:06
Avatar de carlos_belisario
Colaborador
 
Fecha de Ingreso: abril-2010
Ubicación: Venezuela Maracay Aragua
Mensajes: 3.156
Antigüedad: 14 años
Puntos: 461
Respuesta: Campos personalizados desde páginas.

Bueno porque no es un error de sintaxis, sino un error al momento de escribir el codigo ya que estas sobreescribiendo una variable inmediatamente de haberla definido por eso no te da ningun error en la aplicacion , saludos y gracias por el karma
__________________
aprende d tus errores e incrementa tu conocimientos
it's not a bug, it's an undocumented feature By @David
php the right way
  #16 (permalink)  
Antiguo 27/04/2011, 00:16
Avatar de j_aroche
Server Ninja
 
Fecha de Ingreso: agosto-2006
Ubicación: iPhone: 14.624481,-90.487457
Mensajes: 2.066
Antigüedad: 17 años, 8 meses
Puntos: 223
Respuesta: Campos personalizados desde páginas.

Cita:
Iniciado por carlos_belisario Ver Mensaje
ahora verifica bien porque no entiendo el porque del -1
Según la documentación de WP_Query, el -1 es para cargar todos los posts, lo cual no es sano... mejor siempre se limita. Imagina si tienes 1000 posts ;)
__________________
Blog: JavierAroche.com - Twitter: @j_aroche
  #17 (permalink)  
Antiguo 27/04/2011, 08:28
Avatar de pao01
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 1.875
Antigüedad: 15 años, 10 meses
Puntos: 351
Respuesta: Campos personalizados desde páginas.

Cita:
Iniciado por j_aroche Ver Mensaje
Según la documentación de WP_Query, el -1 es para cargar todos los posts, lo cual no es sano... mejor siempre se limita. Imagina si tienes 1000 posts ;)
Eso no lo sabía, pero está bueno tener conocimiento ahora de ello. De todos modos me quedo tranquila ya que al haber variado la función a mostrar sólo contenido de páginas, no serán más de 6 ó 7 "contenidos"
__________________
Entre más estrecha la mente, más grande la boca.- Ted Cook
Autosconarte-Blog
  #18 (permalink)  
Antiguo 27/04/2011, 11:26
Avatar de carlos_belisario
Colaborador
 
Fecha de Ingreso: abril-2010
Ubicación: Venezuela Maracay Aragua
Mensajes: 3.156
Antigüedad: 14 años
Puntos: 461
Respuesta: Campos personalizados desde páginas.

Cita:
Iniciado por j_aroche Ver Mensaje
Según la documentación de WP_Query, el -1 es para cargar todos los posts, lo cual no es sano... mejor siempre se limita. Imagina si tienes 1000 posts ;)
excelente, no lo conocia creo que voy a revisar un poco mas esta funcion a ver en que mas me puede ser util saludos
__________________
aprende d tus errores e incrementa tu conocimientos
it's not a bug, it's an undocumented feature By @David
php the right way
  #19 (permalink)  
Antiguo 28/04/2011, 03:41
Avatar de zanguanga
Moderadora
 
Fecha de Ingreso: julio-2009
Ubicación: España
Mensajes: 1.686
Antigüedad: 14 años, 9 meses
Puntos: 429
Respuesta: Campos personalizados desde páginas.

Cita:
Iniciado por carlos_belisario Ver Mensaje
excelente, no lo conocia creo que voy a revisar un poco mas esta funcion a ver en que mas me puede ser util saludos
Que yo sepa, suele emplearse en las páginas de archivo, y para crear site maps
__________________
Mi blog personal | Mi G+

Etiquetas: campos, personalizacion
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 12:48.