img src not working correctly in custom post type

Add this following function to your functions.php of your theme or child theme. function homeURLshortcode() { return home_url(); } add_shortcode(‘homeurl’, ‘homeURLshortcode’); This will create a shortcode like [homeurl] which you can use to add in any visual editor and it will render as your main domain address, like http://domain.com. So for your image url you … Read more

Custom Taxonomy Tags and Category using same slug

So I got this working by adding /tag or /category for the rewrite slug, rather then publications or publications/%publications_tag%. I initally thought both taxonomy types could live in the parent post-type and wordpress would figure the rest out. Tags: ‘rewrite’ => array( ‘slug’ => ‘publication/tag’, ‘with_front’ => false ), Looks like: domain.test/publications/tag/example-tag/ and use’s the … Read more

wp_dropdown_categories() searching is not working with CPT, please review my code

Working drop down in search for CPT <?php $categories = get_categories(‘taxonomy=custom-tax’); $select = “<select name=”cat” id=’cat’ class=”postform”>n”; $select.= “<option value=”-1″>Select category</option>n”; foreach($categories as $category){ if($category->count > 0){ $select.= “<option value=””.$category->slug.””>”.$category->name.”</option>”; } } $select.= “</select>”; echo $select; ?> <script type=”text/javascript”><!– var dropdown = document.getElementById(“cat”); function onCatChange() { if ( dropdown.options[dropdown.selectedIndex].value != -1 ) { location.href = … Read more

Bulk edit for custom taxonomy

What you are looking for is custom taxonomy (which has been mentioned in the comments). Which you create with the register_taxonomy() function. There is a beginners guide here if you need it. You will need to pass in an array of arguments. The most important is probably hierarchical which is true for something like categories, … Read more