-
AuthorPosts
-
April 23, 2022 at 4:10 pm #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,
MarinaApril 23, 2022 at 11:26 pm #1349249Hey MarynaKudzinava,
Are you using the masonry setting: Sorting ▸ Yes, display sort options and are referring to the “All” at the start?
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
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,
MikeApril 24, 2022 at 11:54 am #1349273Hello 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,
MarinaApril 24, 2022 at 6:43 pm #1349289Hi,
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,
MikeApril 25, 2022 at 12:23 am #1349305Thank you, works perfect.
Best regards,
MarinaApril 25, 2022 at 6:22 am #1349339Hi Marina,
We’re glad that Mike could help you :)
Thanks for using Enfold and have a great day!Best regards,
Nikko -
AuthorPosts
- The topic ‘Color and replacement of the word ALL in masonry Portfolio and Blog’ is closed to new replies.