Information on plugin adding text when a post, page, or other such is displayed

Add this filter to functions.php file. Make your changes as needed. function display_my_content( $content ) { if ( is_single() ) { $the_content=”Before your content”; $the_content .= $content; $the_content .= ‘After your content’; return $the_content; } else { return $content; } } add_filter( ‘the_content’, ‘display_my_content’ ); WordPress theme API or plugin API can be used anywhere, … Read more

Copied files from plugin to theme not working

To get the template directory, you can use get_template_directory_uri() like this: $themeDir = get_template_directory_uri(); // … $themeItems = $themeDir . ‘/my_folder/my_items.php’; if (file_exists($themeItems)) return $themeItems; else return $pluginDir . ‘/template/my_items.php’; For more info visit Function Reference/get template directory uri.. If you want to place your PHP code in your theme directory, the better place for … Read more

How to get terms for taxonomy

Try this code <?php //list terms in a given taxonomy $taxonomy = ‘industry’; $tax_terms = get_terms($taxonomy); ?> <ul> <?php foreach ($tax_terms as $tax_term) { echo ‘<li>’ . ‘<a href=”‘ . esc_attr(get_term_link($tax_term, $taxonomy)) . ‘” title=”‘ . sprintf( __( “View all posts in %s” ), $tax_term->name ) . ‘” ‘ . ‘>’ . $tax_term->name.'</a></li>’; } ?>