Calling the Next category link on an archive page – WordPress

The problem here is that you’re not using the function correctly – it returns an object, and won’t output anything by itself. You also need to ensure that $slug and your other arguments are set & have values, otherwise you’ll just trigger an error. Personally, I’d go one step further and use the following function … Read more

A blank page is shown after I add a Function

Have you tried this: <?php add_action( ‘template_redirect’, ‘wp138320_template_redirect’ ); function wp138320_template_redirect() { if ( ! current_user_can( ‘manage_options’ ) ) { include( get_template_directory() . ‘/holding.php’ ); exit; } } ?> I’m currently working on a site that has issues with hooking into actions/filters like that too, changing it to something like the code above did the … Read more

Removing all my hardcoded URLs with get_site_url()

You actually already were pretty close: function autoblank($text) { $return = str_replace(‘href=”https://wordpress.stackexchange.com/questions/138730/,”target=”_blank” href=”, $text); $return = str_replace( “target=”_blank” href=”‘ . get_site_url(), ‘href=”‘ . get_site_url(), $return ); $return = str_replace(‘target=”_blank” href=”#”https://wordpress.stackexchange.com/questions/138730/,”href=”#’, $return); return $return; } add_filter(‘the_content”https://wordpress.stackexchange.com/questions/138730/,”autoblank’); add_filter(‘comment_text”https://wordpress.stackexchange.com/questions/138730/,”autoblank’);

How to display data from custom fields in my custom shortcode?

You simply need to query your custom fields and return them with your shortcode: // EXAMPLE USAGE: // [loop the_query=”showposts=100&post_type=page&post_parent=453″] function custom_query_shortcode($atts) { // Defaults extract(shortcode_atts(array( “the_query” => ” ), $atts)); // de-funkify query $the_query = preg_replace(‘~&#x0*([0-9a-f]+);~ei’, ‘chr(hexdec(“\\1″))’, $the_query); $the_query = preg_replace(‘~&#0*([0-9]+);~e’, ‘chr(\\1)’, $the_query); // query is made query_posts($the_query); // Reset and setup variables $output=””; … Read more