How to Put a button with Link Just after the Title

Posted in: Newspaper
Post count: 104

Hello,

I have newspaper v6.5 installed on my website.

URL – https://www.naukrinama.com

I want to put a button ahead of the post title that will contain a URL. The URL would come from a custom field attribute that I have created for a post.

For Example – http://gadgets.ndtv.com/mobiles/news/meet-the-android-phone-with-a-humungous-10000mah-battery-776134 (See the button next to title)

Can you tell me how can this be achieved and where exactly I have to make the changes ?

Post count: 23312

Hello rishab55555

Below, I gave you an example for what you want to achieve to put a button after the posts title. First of all, you need to make a custom class and add an image button you like and place it in loop_single.php, like this: http://screencast.com/t/FapsZDElh and also the code you should find here: http://pastebin.com/iHh4SKpy . After this changes, you have to use a bit of Css with the code below:

.button {
position: relative;
float: left;
display: block;
top: 9px;
padding-right: 10px;
}

The result you should see here: http://screencast.com/t/9uofVar07nx

There is just an example. You can adjust the values and put another image source until you get what you want.

If you want to have another different button for each post title, please find a plugin to do this for you.

Hope this helps!

Thank you for the message!

Post count: 104

Hello Catalin,

Thanks for your revert !

I wanted something like this only. But can you tell me where do I have to place this code if i want the button to be displayed just after the title. So wherever the title ends be it 1st line or 2nd line, just after it the button would come.

I tried placing the code below the get_title line but it brought the button to the next line.

Let me know how can this be achieved.

Post count: 23312

Hello rishab55555,

Please remove all the customization that I gave you above and please try to change your td_module_single_base.php with this code: http://pastebin.com/5BcBJA4r, like this: http://screencast.com/t/RgT1hhlr .
The result you should see here: http://screencast.com/t/Pmmsod56NRng.

Hope this helps and let us know how it goes!

Thank you for the message!

Post count: 104

Hello Catalin,

I recently upgraded my theme version to v6.7 from v6.5 and soon after it this feature has stopped working on my website.
I have re-checked that the code is placed at the correct location as mentioned above but still nothing shows up on the front end.

Please let me know how to get this fixed.

Post count: 23312

Hello rishab55555,

Please try to update the theme to the latest version of it (Newspaper 7.3) and then try to implement again the method which I gave you above. In generally, the code remained the same and should work as properly. Please notice that I only give you a hint in this case and then you will have to do it yourself.

Thanks for your understanding!

Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic.