Okay
  Public Ticket #3225193
Cambiar la imagen de showcase en responsive
Closed

Comments

  •  4
    Carlos Vera started the conversation

    Necesito poder cambiar la imagen principal (Background) por otra diferente cuando se muestra en su versión responsive (mobile), para poder agregar una imagen más adaptada, ya que en el demo se ve muy bonita pero en la vida real no es funcional porque nuestros productos no pueden ocupar toda la pantalla, os dejo una imagen que me gustaria colocar en la versión movil para los showcase

    Attached files:  Banner-RO-01-Soluwater-mobile.jpg

  •  1,815
    Support replied

    Hi Carlos,

    We can do this custom work (different hero image on mobile) for a fee if you are interested or you can implement it yourself - we can give pointers on how and what to change. Let us know.

    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy

  •  4
    Carlos Vera replied

    Me encantaría leer esos consejos y que me comenten que archivos cambiar, lo agradecería enormemente, ya que ahora no podemos permitírnoslo, quedo a la espera de vuestra amable respuesta... 

  •  1,815
    Support replied

    Hi,

    so: 1. first thing is to add in /include/metabox-config.php am option for mobile hero image for portfolio items. After the actual hero image. For example

    array(
    'id'        => 'humpton-opt-portfolio-hero-img-nobile',
                    'type'      => 'media',
                    'url'       => true,
                    'title'     => esc_html__('Hero Image For Mobile', 'humpton'),
                    'desc'      => esc_html__('Upload hero background image. The hero image is the fullscreen image in hero section. Hero section is the header section displayed at the top of the individual project page.', 'humpton'),
                    'default'   => array(),
                ),


    2. in /include/hero-properties.php use wp_is_mobile() function to distinguisl between the two

    instead

    $this->image = humpton_get_post_meta( HUMPTON_THEME_OPTIONS, $this->post_id, 'humpton-opt-portfolio-hero-img' );

    use

    if( wp_is_mobile() ){

           $this->image = humpton_get_post_meta( HUMPTON_THEME_OPTIONS, $this->post_id, 'humpton-opt-portfolio-hero-img-mobile' );

    }

    else {

            $this->image = humpton_get_post_meta( HUMPTON_THEME_OPTIONS, $this->post_id, 'humpton-opt-portfolio-hero-img' );

    }

    I think that should  be enough.

    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy

  •  4
    Carlos Vera replied

    Hola Equipo Support,

    Ya he realizado todo lo comentado pero ahora donde puedo agregar la imagen para mobile, por otro lado os dejo captura de los cambios realizados, estos cambios se han realizado en el child theme (para que no se sobre-escriban con alguna actualización).

    Espero vuestros comentarios y soluciones...

    PD: He solucionado un pequeño fallo en el array ya que escribiste nobile es ves de mobile...

    Attached files:  Captura de pantalla 2023-02-10 a las 15.19.26.png

  •  4
    Carlos Vera replied

    Adjunto las otras imágenes que olvide en el anterior mensaje...

    Attached files:  Captura de pantalla 2023-02-10 a las 15.22.40.png
      Captura de pantalla 2023-02-10 a las 15.24.52.png

  •  1,815
    Support replied

    Hi Carlos, the modifications I mentioned in my prev comment should be made in the parent theme

    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy

  •  4
    Carlos Vera replied

    Una pregunta, lo perderé en alguna actualización o lo incluirán en su próxima actualización

  •  1,815
    Support replied

    The changes are in the parent theme and can be merged after the upgrade to a new version.

    the difficulty is that you cannot split the /include/metabox-config.php and /include/hero-properties.php.

    if you figure out a better solution, plz go ahead and implement it hust use the changes we made

    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy

  •  4
    Carlos Vera replied

    No entiendo vuestra respuesta, ya he realizado los cambios pero no puedo ver donde ingresar la imagen para la versión móvil, me podéis explicar donde se subiría dicha imagen?

  •  1,815
    Support replied

    If you implemented it properly you should find in portfolio item options underneath the hero image. Also plz write in English as it is the only language our support team is using.

    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy

  •  4
    Carlos Vera replied

    Ok perfect I have located it and it is ok, only a small detail, it happens the same as with the large images must be all placed to display them otherwise the screen is displayed in black...

    Attached files:  Captura de pantalla 2023-02-13 a las 10.19.39.png

  •  1,815
    Support replied

    Hi Carlos yes you can change the prev code so that when the mobile image is not found will display the desktop image

    if( wp_is_mobile() ){

           $this->image = humpton_get_post_meta( HUMPTON_THEME_OPTIONS, $this->post_id, 'humpton-opt-portfolio-hero-img-mobile' );

           if( !$this->image ){

               // if the mobile image is not found, use the desktop image  

               $this->image = humpton_get_post_meta( HUMPTON_THEME_OPTIONS, $this->post_id, 'humpton-opt-portfolio-hero-img' );

          }

    }

    else {

            $this->image = humpton_get_post_meta( HUMPTON_THEME_OPTIONS, $this->post_id, 'humpton-opt-portfolio-hero-img' );

    }


    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy