-
AuthorPosts
-
April 16, 2019 at 6:45 pm #1091620
We added the following script to functions.php so we could change the ‘read more’ text to ‘Answer’. When we do this, the text does change but the arrow disappears. We want to keep the arrow. Any suggestions? Thanks.
function custom_more_link(){
?>
<script>
(function($){
$(document).ready(function(){
$(“.more-link”).text(“Answer”);
});
})(jQuery);
</script>
<?php
}
add_action(‘wp_footer’, ‘custom_more_link’);April 16, 2019 at 6:57 pm #1091623Sorry, I meant to also add that we tried to change the ‘read more’ using the solution on this thread: https://kriesi.at/support/topic/read-more-link/#post-356003 but it only worked if we made the change directly to the Enfold copy. Creating a child-theme copy of the folders path and file did not work. We are fine with either changes to the postslider.php file in child theme or editing function.php, but neither method is working well for us. Your insight is appreciated–thank you.
April 17, 2019 at 10:52 am #1091903Hi GWS,
You’ll need to add this after Answer:
<span class="more-link-arrow"></span>Best regards,
NikkoApril 17, 2019 at 4:23 pm #1092061Thank you for responding so quickly. When I add the span class the arrow shows up, but ignores the change from Read more to Answer. The syntax appears to be correct. What I am missing, please?
function custom_more_link(){
?>
<script>
(function($){
$(document).ready(function(){
$(“.more-link”).text(“Answer”) <span class=”more-link-arrow”></span>;
});
})(jQuery);
</script>
<?php
}
add_action(‘wp_footer’, ‘custom_more_link’);April 19, 2019 at 5:48 am #1092573Hi GWS,
Try to use this code:
function custom_more_link(){ ?> <script> (function($){ $(document).ready(function(){ $(".more-link").html("Answer <span class='more-link-arrow'></span>"); }); })(jQuery); </script> <?php } add_action('wp_footer', 'custom_more_link');Hope it helps.
Best regards,
NikkoApril 22, 2019 at 10:38 pm #1093419That worked — thank you!
April 24, 2019 at 3:34 am #1093804Hi GWS,
We’re glad that we could help :)
Thanks for using Enfold and have a great day!Best regards,
Nikko -
AuthorPosts
- The topic ‘Post Slider – change 'read more' text but keep arrow’ is closed to new replies.
