New Landing How can we help? Atelier Related Projects Name and Dimensions

Viewing 15 posts - 1 through 15 (of 16 total)
  • Posted in: Atelier
  • #222663
    agermster
    Member
    Post count: 10

    I am using the Portfolio with images that are portrait (1:1.4 ratio).

    1.) How do I change the dimensions of the “Related Projects” shown at the bottom of a portfolio item page? Right now it is cropping images and cutting them off. I want it to show images at 225 x 325 pixels.

    2.) How do I change the name of the section from “Related Projects” to “Related Celebrities” or similar?

    3.) How do I change the Portfolio home page widget link that says “View All Projects” to something else?

    Thanks!

    Attachments:
    You must be logged in to view attached files.
    #222802
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Hi

    Add this to your child theme’s functions.php file:

    /* PORTFOLIO RELATED PROJECTS
        ================================================== */
        if ( ! function_exists( 'sf_portfolio_related_projects' ) ) {
            function sf_portfolio_related_projects() {
                global $post, $sf_options;
                $fullwidth  = $sf_options['related_projects_fullwidth'];
                $item_count = $sf_options['related_projects_columns'];
                $related    = sf_portfolio_related_posts( $post->ID, $item_count );
                $item_class = "col-sm-4";
                $wrap_class = $heading_class = "";
                if ( $fullwidth ) {
                    $heading_class = "container";
                } else {
                    $wrap_class = "container";
                }
                $hover_style = "default";
    
                // Thumb Type
                if ( function_exists( 'sf_get_thumb_type' ) && sf_theme_opts_name() == "sf_atelier_options" ) {
                    $wrap_class .= ' ' . sf_get_thumb_type();
                } else if ( function_exists( 'sf_get_thumb_type' ) && $hover_style == "default" ) {
                    $wrap_class .= ' ' . sf_get_thumb_type();
                } else {
                    $wrap_class .= ' thumbnail-' . $hover_style;
                }
    
                if ( $item_count == "4" ) {
                    $item_class = "col-sm-3";
                }
                if ( $related->have_posts() ) {
                    ?>
                    <section class="related-projects <?php echo esc_attr($wrap_class); ?> clearfix">
    
                        <h2 class="<?php echo esc_attr($heading_class); ?>"><?php echo apply_filters('sf_related_projects_heading', __( "Related Projects", "swiftframework" )); ?></h2>
    
                        <div class="clearfix">
                            <?php while ( $related->have_posts() ): $related->the_post(); ?>
                                <?php
                                $item_title    = get_the_title();
                                $item_subtitle = sf_get_post_meta( $post->ID, 'sf_portfolio_subtitle', true );
                                $thumb_image   = $port_hover_style = $port_hover_text_style = "";
                                $thumb_image   = sf_get_post_meta( $post->ID, 'sf_thumbnail_image', true );
                                if ( ! $thumb_image ) {
                                    $thumb_image = get_post_thumbnail_id();
                                }
                                $thumb_img_url = wp_get_attachment_url( $thumb_image, 'full' );
                                if ( $thumb_img_url == "" ) {
                                    $thumb_img_url = "default";
                                }
                                $image                 = sf_aq_resize( $thumb_img_url, 500, 375, true, false );
                                $image_alt             = esc_attr( sf_get_post_meta( $thumb_image, '_wp_attachment_image_alt', true ) );
                                $port_hover_bg_color   = sf_get_post_meta( $post->ID, 'sf_port_hover_bg_color', true );
                                $port_hover_text_color = sf_get_post_meta( $post->ID, 'sf_port_hover_text_color', true );
                                if ( $port_hover_bg_color != "" ) {
                                    $overlay_opacity = $sf_options['overlay_opacity'];
                                    if ( $overlay_opacity == 100 ) {
                                        $overlay_opacity = '1';
                                    } else {
                                        $overlay_opacity = '0.' . $overlay_opacity;
                                    }
                                    $port_hover_bg_rgb = sf_hex2rgb( $port_hover_bg_color );
                                    $port_hover_style  = 'style="background-color:rgba(' . $port_hover_bg_rgb['red'] . ',' . $port_hover_bg_rgb['green'] . ',' . $port_hover_bg_rgb['blue'] . ',' . $overlay_opacity . ')"';
                                }
                                if ( $port_hover_text_color != "" ) {
                                    $port_hover_text_style = 'style="color: ' . $port_hover_text_color . ';"';
                                }
                                ?>
    
                                <article class="<?php echo esc_attr($item_class); ?>">
                                    <figure class="animated-overlay overlay-style">
                                        <img src="<?php echo esc_url($image[0]); ?>" width="<?php echo esc_attr($image[1]); ?>"
                                             height="<?php echo esc_attr($image[2]); ?>" alt="<?php echo esc_attr($image_alt); ?>"/>
                                        <a href="<?php the_permalink(); ?>"></a>
                                        <figcaption <?php echo esc_attr($port_hover_style); ?>>
                                            <div class="thumb-info">
                                                <h4 <?php echo esc_attr($port_hover_text_style); ?>><?php echo esc_attr($item_title); ?></h4>
    
                                                <div class="name-divide"></div>
                                                <h5 <?php echo esc_attr($port_hover_text_style); ?>><?php echo esc_attr($item_subtitle); ?></h5>
                                            </div>
                                        </figcaption>
                                    </figure>
                                </article>
                            <?php endwhile; ?>
                        </div>
    
                    </section>
    
                <?php
                }
            }
    

    you’ll need to edit the h2 tag:

    <h2 class="<?php echo esc_attr($heading_class); ?>"><?php echo apply_filters('sf_related_projects_heading', __( "Related Projects", "swiftframework" )); ?></h2>

    to change Related Projects to something else

    To change the image sizes you will need to edit this line:

    $image = sf_aq_resize( $thumb_img_url, 500, 375, true, false );

    – Kyle

    #225633
    agermster
    Member
    Post count: 10

    I tried to make the update to the child theme and received a syntax error that I had to reverse in order to make the site operational.

    Leaving that question alone for one second, can you please let me know how to change the “View All Projects” and “View All Products” and “View All Articles” text on the SPB widgets for Portfolio, Products and Blog? For example, I want the “View All Projects” text in the attached screenshot to say “View All” only. Thanks!

    Attachments:
    You must be logged in to view attached files.
    #225654
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    The easiest way to change those would be to use the Codestyle Localization plugin and edit the strings

    – Kyle

    #225665
    agermster
    Member
    Post count: 10

    Do you mind providing a link to this plugin? In my research it looks like this plugin is no longer live or supported. Please advise.

    #225666
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    That’s odd

    Try this one: https://wordpress.org/plugins/loco-translate/

    – Kyle

    #226867
    agermster
    Member
    Post count: 10

    I am confused by the purpose of this plugin as I do not need to translate anything. Can you please provide further instructions or advice? I need each of the widgets on the home page to have a link that reads “View All” and this is something my client really wants before I can close out the project. Thanks!

    #226931
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Using translation plugins makes it easy to change the words the theme uses, you don’t have to translate the theme to another language you just change a few strings.

    The only other way would be to edit the theme files but you would need to edit each file

    – Kyle

    #228792
    agermster
    Member
    Post count: 10

    I have the plugin installed. Are you able to login to my admin and make the changes? It’s one of the last changes needed for me to close out the project.

    The other thing is the the same question as my original, can you add the code to my functions.php in order to fix the dimensions on the Related Celebrities on pages like this: http://grazielagems.com/portfolio/taylor-swift/

    Those pages do not look good right now. You have full permission to login to the site and make the changes. Thanks!

    #229222
    agermster
    Member
    Post count: 10

    Are you able to provide services to complete my original 3 questions? These are the last items I need closed out in order to bill the client. You have my permission to login and make the changes if at all possible. Thanks!

    1.) How do I change the dimensions of the “Related Projects” shown at the bottom of a portfolio item page? Right now it is cropping images and cutting them off. I want it to show images at 225 x 325 pixels.

    2.) How do I change the name of the section from “Related Projects” to “Related Celebrities” or similar?

    3.) How do I change the Portfolio home page widget link that says “View All Projects” to something else?

    #229534
    agermster
    Member
    Post count: 10

    When I try to update functions.php with the code you provide, I get this error message:

    Parse error: syntax error, unexpected end of file in /home/content/p3pnexwpnas01_data03/11/2936911/html/wp-content/themes/atelier/functions.php on line 726

    #229880
    David Martin – Support
    Moderator
    Post count: 20834

    Hi,

    Do not edit your theme functions.php file, you will need to put the amended code into the supplied child theme, inside the child theme folder there is a functions.php that you will need to add the changes to.

    Please use this plugin to find and replace “https://wordpress.org/plugins/real-time-find-and-replace/&#8221; https://wordpress.org/plugins/real-time-find-and-replace/

    Thanks,
    David.

    #237646
    afaraji
    Member
    Post count: 72
    This reply has been marked as private.
    #238064
    David Martin – Support
    Moderator
    Post count: 20834

    That will likely mean there is a missing PHP tag in the functions.php file.

    Please add your FTP details and we will take a look for you.

    Thanks.

    #238689
    afaraji
    Member
    Post count: 72

    No worries David, I fixed it myself via FTP. Though I’m still having some issue making my changes in the functions.php file take effect.

    I’ve created a new thread regarding the matter. (http://www.swiftideas.com/forums/topic/changing-related-products-and-title-in-functions-php/)

    Thanks!

Viewing 15 posts - 1 through 15 (of 16 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register