0
votes

Basically, my Wordpress site has about 50,000 unique posts, I want to incorporate asdfly to the next/previous post link buttons. I want to insert asdfly/527275432/ before the next/previous url, so it would look like this..

asdfly/527274352/www.google.com/previous

(Previous Post Title)

asdfly/527274352/www.google.com/next

(Next Post Title)

Is there any possible way to do this? I tried with the template but I couldn't figure it out.. Someone had managed to help me before but the same code doesn't work on the new site I'm working with, this is a different theme so maybe that's why. Here is what my current next and previous post buttons are/look like:

<div class="right-side">
    <?php
        if( $prev_link != NULL )
            echo $prev_link . "<i title='Last Episode' class='playerleft tooltips   fa fa-angle-double-left'> </i></a>";?>
    <a class="tooltips" title='View all <?php echo $name; ?> Episodes' href='<?php echo     $series_link; ?>'><i class="allepisodes fa fa-sort-amount-asc"></i></a>
    <?php
        if( $next_link != NULL )
            echo $next_link . "<i title='Next Episode'class='playerright tooltips fa fa-angle-double-right'> </i></a>"; ?>

</div> <!-- End of right side -->

This is the previous code someone has gotten for me, however it doesn't work on this website:

function modify_prev_link( $link ) {
  $link = str_replace( "href=\"http://", "href=\"http://asdf.ly/527274352/", $link );
  return $link;
}
add_filter( 'previous_post_link', 'modify_prev_link' );

function modify_next_link( $link ) {
    $link = str_replace( "href=\"http://", "href=\"http://asdf.ly/527274352/", $link );
    return $link;
}
add_filter( 'next_post_link', 'modify_next_link' );

An example of what this would look like on the page:

http://animewolf.tv/anime/yama-no-susume-2nd-season-episode-21-subbed/

If you refer to the buttons on the right side below the video player, I want to modify them so that the adfly code will come before the url of the next episode.

I've been going crazy trying to find an answer for this, if anyone knows of one I will tip you $5 paypal, just leave me your pp after I've confirmed it's worked :) just a little side note to show my appreciation.

Thanks

1

1 Answers

0
votes

Not sure if this will work, but tested on wordpress with different template.

I tried with your button link which don't work on my templates.

Changed code for button link (most likely on single.php file)

<?php next_post_link( '%link', "<i title='Last Episode' class='playerleft tooltips   fa fa-angle-double-left'> </i>", TRUE ); ?>
<a class="tooltips" title='View all <?php echo $name; ?> Episodes' href='<?php echo     $series_link; ?>'><i class="allepisodes fa fa-sort-amount-asc"></i></a>
<?php previous_post_link( '%link', "<i title='Next Episode'class='playerright tooltips fa fa-angle-double-right'> </i></a>", TRUE ); ?>

edit on your function.php file (changing function) working fine.

Hope it help.

:)