How can I link to the most recent post in a category?

It’s not built into core, but it’s certainly possible to add, however – I wouldn’t consider it a good idea to have a single post available at multiple URLs, so a redirect is probably best. Of course, it will require a bit of PHP, as WordPress doesn’t operate on magic or willpower. First, we hook … Read more

Get the prev / next page links only (not title, etc)

Short answer: get_previous_posts_page_link is the function you want: <?php if($url = get_previous_posts_page_link()): ?> do stuff with $url <?php endif; ?> Longer answer: follow the code. previous_posts_link calls get_previous_posts_link. <?php /** * Display the previous posts page link. * * @since 0.71 * @uses get_previous_posts_link() * * @param string $label Optional. Previous page link text. */ … Read more

Add CSS Class to Link in TinyMCE editor

One option is to add a class to the Styleselect menu in MCE. Adapted from the “TinyMCE Custom Styles” Codex page you first need to add the style select to the editor: // Callback function to insert ‘styleselect’ into the $buttons array function my_mce_buttons_2( $buttons ) { array_unshift( $buttons, ‘styleselect’ ); return $buttons; } // … Read more

How to use wpLink without editor?

There is not ethical way of doing this. But still there is a way to do this. WordPress wrote wpLink script keeping in mind that editor is there but still WordPress handle when editor is not there (Good Thing) Consider this example and assume that we are using it on front-end in footer. First enqueue … Read more

Get parent page url to show up when it is in child pages

You can use something like this to get the parent page URL (and show its page title): <?php if ( $post->post_parent ) { ?> <a href=”https://wordpress.stackexchange.com/questions/192895/<?php echo get_permalink( $post->post_parent ); ?>” > <?php echo get_the_title( $post->post_parent ); ?> </a> <?php } ?> If you are running this code outside of the loop (thanks @BorisKuzmanov), then … Read more

techhipbettruvabetnorabahisbahis forumueduseduseduseduedueduedusedueduedus