ksweat234 Posted September 5, 2014 Share Posted September 5, 2014 Hey guys I am trying to link my post tilte for pagnation to the actual post. This is wordpress blog-page.php MY SITE IS GSUEAGLENATION.COM on the homepage any of the sliders you can tell that the pagnantion titles don't link anywhere $slider_pagination[] = get_the_title(); ------- I have tried messing around with this code and it just messesup my site snippet EXAMPLE BELOW OF WHERE MY CODE IS PULLING <div class="pager-desc"> <span class="cs-desc"> '.$slider_title.' ---------------------------this is where my titles are showing up on my site but Its only pulling the title I want to like the title to the post</span> </div> </li>'; } echo '</ul></div>'; } px_enqueue_cycle_script(); endif; wp_reset_postdata(); \ page_blog.php Quote Link to comment https://forums.phpfreaks.com/topic/290877-php-slider-pagnation-post-title-link/ Share on other sites More sharing options...
darkfreaks Posted September 6, 2014 Share Posted September 6, 2014 $slider_pagination = get_the_title(); // just echos the title change to: $slider_pagination = echo '<a href="' . get_permalink($post->ID) . '">' .get_the_title() . '</a>'; // now becomes a linked title Quote Link to comment https://forums.phpfreaks.com/topic/290877-php-slider-pagnation-post-title-link/#findComment-1490158 Share on other sites More sharing options...
ksweat234 Posted September 8, 2014 Author Share Posted September 8, 2014 (edited) Thanks. When I add your code in replace of it. the pagnation link works but the rest of the front page gets cut off and the pagnation freezes. When ever I try to add a link to the title in that pagnation the site cuts off and freezes. Edited September 8, 2014 by ksweat234 Quote Link to comment https://forums.phpfreaks.com/topic/290877-php-slider-pagnation-post-title-link/#findComment-1490334 Share on other sites More sharing options...
cyberRobot Posted September 8, 2014 Share Posted September 8, 2014 It might help if you post the updated code. When posting the code, please surround it with tags. It makes your post and code easier to follow. Also note that echo shouldn't be used after an assignment operator. This: $slider_pagination = echo '<a href="' . get_permalink($post->ID) . '">' .get_the_title() . '</a>'; Should be this: $slider_pagination[] = '<a href="' . get_permalink($post->ID) . '">' .get_the_title() . '</a>'; Quote Link to comment https://forums.phpfreaks.com/topic/290877-php-slider-pagnation-post-title-link/#findComment-1490341 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.