Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Add a link above individual blog post title


taycw

Question

I am trying to make the text "Notes, Queries and Explanations" at the top of the individual blog posts a link back to the home blog page.

The text is currently added using the content attribute and am having trouble working out the javascript. What can I do to make that a link? 

Edited by taycw
Link to post
  • Answers 2
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

Popular Posts

Thanks! That did the trick!

2 answers to this question

Recommended Posts

  • 0

Add the following to Blog Settings > Advanced > Page Header Code Injection for the blog page.

<script>

  $( ( ) => {
  
    /*
    
      begin add linked text to blog title
      
      SS Version : 7.0
      Template   : Brine family
      
      */
      
      const text = 'NOTES, QUERIES AND EXPLANATIONS';
      
      const url = '/notes-queries-and-explanations';
      
      // do not change anything below, there be the borg here
      
      $( '<a>' +
      
        text +
        
        '</a>' )
        
        .attr ( 'href', url )
        
        .prependTo ( '.BlogItem-title' );
        
      // end add linked text to blog title
      
    } );
    
  </script>

This is for a v7.0 site using the Brine template family.

You can retarget your CSS from .BlogItem-title:before to .BlogItem-title a and make the minor adjustments needed.

Let us know how it goes.

Find my contributions useful? Please like, upvote, mark my answer as best , and see my profile. Thanks for your support!

Link to post
  • 0
16 hours ago, creedon said:

Add the following to Blog Settings > Advanced > Page Header Code Injection for the blog page.


<script>

  $( ( ) => {
  
    /*
    
      begin add linked text to blog title
      
      SS Version : 7.0
      Template   : Brine family
      
      */
      
      const text = 'NOTES, QUERIES AND EXPLANATIONS';
      
      const url = '/notes-queries-and-explanations';
      
      // do not change anything below, there be the borg here
      
      $( '<a>' +
      
        text +
        
        '</a>' )
        
        .attr ( 'href', url )
        
        .prependTo ( '.BlogItem-title' );
        
      // end add linked text to blog title
      
    } );
    
  </script>

This is for a v7.0 site using the Brine template family.

You can retarget your CSS from .BlogItem-title:before to .BlogItem-title a and make the minor adjustments needed.

Let us know how it goes.

Thanks! That did the trick!

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...