Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1349229

    Hello,
    I would like to:
    1. Change color and font settings of the word ALL on top of the general masonry Portfolio and Blog pages.
    2. Replace the word ALL for masonry Portfolio by the word “Portfolio”.
    3. Replace the word ALL for masonry Blog by the word “Blog”.
    Thank you,
    Marina

    #1349249

    Hey MarynaKudzinava,
    Are you using the masonry setting: Sorting ▸ Yes, display sort options and are referring to the “All” at the start?
    2022-04-23_007.jpg
    try this css for the masonry sort of the blog and portfolio:

    .av-portfolio-grid-sorting-container .all_sort_button,
    .av-masonry-sort .all_sort_button {
    	font-size: 16px;
        color: red !important; 
    }
    

    But if you mean the setting: Sorting ▸ Yes, display sort options and currently active taxonomy and are referring to the current sort title
    2022-04-23_008.jpg
    then try this css for the masonry sort title of the blog and portfolio:

    .av-portfolio-grid-sorting-container .all_sort_button,
    .av-portfolio-grid-sorting-container .av-current-sort-title,
    .av-masonry-sort .all_sort_button,
    .av-masonry-sort .av-current-sort-title {
    	font-size: 16px;
        color: red !important; 
    }

    After applying the css, please clear your browser cache and check, then link to your two elements and explain if you mean the “All” at the start or current sort title for replacing the words.
    Please note that the current sort title changes depending on the sort clicked, it doesn’t always show “All” so replacing it with the word “Portfolio” or “Blog” would change this behavior.

    Best regards,
    Mike

    #1349273

    Hello Mike,

    Thank you for the code, I used the second one.

    I am referring to the displayed in big taxonomy title, not the first item in the line of sort options. I would like to replace the displayed taxonomy title for the “All” sort option for portfolio by the word “Portfolio”, and correspondingly for the blog – by the word “Blog”.

    I am working on the basis of the Enfold Photography demo, so the target pages are:

    Currently, the word “All” is not informative for the visitor, where he is, especially on mobile. The first item in the line of sort options can remain to be “All”, but when you click it, the displayed title should be “Portfolio” or “Blog” respectively, other sort options should function as before.

    Thank you for your help,
    Marina

    #1349289

    Hi,
    Based on our two demo pages we can change the current sort title but the page ID must be used because both use the same masonry element and there is no blog or portfolio class above the content in the element source code, if you assign a custom ID to the element then you would not need to use the page ID.
    So for this example the /portfolio/ is page-id-25 and /blog/ is page-id-66
    Add this code to the end of your child theme functions.php file in Appearance ▸ Editor:

    function custom_allToblog_allToportfolio_script() { ?>
        <script>
    (function($){
    	function allToblog() {
      $('#top.page-id-66 .av-masonry-sort>.av-current-sort-title>.inner_sort_button>span').each(function() {
        var text = $(this).text();
        $(this).text(text.replace('All', 'Blog')); 
    });
    }
    $(function() {
    	allToblog();
    });
    $('#top.page-id-66 .av-sort-by-term>.all_sort_button').on('click',function(){
    setTimeout(function(){
     allToblog();
    },10);
    });
    })(jQuery);
    
    (function($){
    	function allToportfolio() {
      $('#top.page-id-25 .av-masonry-sort>.av-current-sort-title>.inner_sort_button>span').each(function() {
        var text = $(this).text();
        $(this).text(text.replace('All', 'Portfolio')); 
    });
    }
    $(function() {
    	allToportfolio();
    });
    $('#top.page-id-25 .av-sort-by-term>.all_sort_button').on('click',function(){
    setTimeout(function(){
     allToportfolio();
    },10);
    });
    })(jQuery);
    </script>
        <?php
    }
    add_action('wp_footer', 'custom_allToblog_allToportfolio_script');

    Best regards,
    Mike

    #1349305

    Thank you, works perfect.
    Best regards,
    Marina

    #1349339

    Hi Marina,

    We’re glad that Mike could help you :)
    Thanks for using Enfold and have a great day!

    Best regards,
    Nikko

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Color and replacement of the word ALL in masonry Portfolio and Blog’ is closed to new replies.