Multisite get_home_url(); – Getting URL for current site

What would be the replacement for get_home_url() when using a multisite? For example, if I have one theme installed across several sites, and within the theme there are links that need to be specific to the current site. On my single install, using get_home_url(); would give me http://domain.com/, which was great, and if I moved … Read more

get_parent_theme_file_path vs. get_template_directory

I’ve been reading about the new functions for referencing theme location added in v4.7. I read through the trac ticket. I understand why they created these functions and the benefit of get_theme_file_path() for use in child themes. But aside from verbal clarity is there a specific reason to use get_parent_theme_file_path() over get_template_directory() when referencing files … Read more

Making a Shortcode [NEXT] and [PREVIOUS] to place into specific posts for post navigation

I really need some help, I dont know where else to turn with this request. I’d like to add a shortcode to one of my posts. The template tags get_next_post() and get_previous will not work for me since I dont want post navigation on each post page and I want to control where it displays. … Read more

why doesn’t the_content() work in this {single-custom_post_type.php} page?

This code is from my page single-publication.php. It outputs the relevant custom fields etc (here wrapped in template tags), but the_content() won’t output the post content. I’ve resorted to using $post->post_content (which works), but the mystery remains: <div class=”publication-info”> <?php printf(“<h2>%s</h2>”, get_the_title() ); ?> <div class=”publication-meta publication-credit”><?php the_publication_credit(); ?></div> <div class=”publication-meta publication-date”><?php the_publication_date(); ?></div><br /> … Read more

Echo author ID in author.php

This is probably a super simple question. But how do I echo the ID of a user on author.php? I’ve tried the_author_meta(‘ID’) But it didn’t seem to want to work. I want to echo it at the end of a URL, for example; http:///www.domain.com/author/sampleauthor-id Obviously, where “id” is that particular author’s ID Any ideas? 3 … Read more