Hot answers tagged

2

The admin-init hook only fires on admin screens. The correct hook to use for registering post types is init. So change: add_action( 'admin_init', 'smoelenboek' ); ... to ... add_action( 'init', 'smoelenboek' ); ... and flush your rewrite rules once (save permalink settings in admin) and all should be well.


1

You got ARRAY echos because you saved array on post meta, Just check array values of meta data like: print_r( get_post_meta($post->ID, 'ptn_systeem', true) ); and echo it like: foreach( (array) get_post_meta($post->ID, 'ptn_systeem', true) as $option): echo $option . "<br>"; endforeach;


1

to highlight the menu element, you should add the class active. This will work for your photo custom post type. Concerning your blog posts: As you can see, in the URL of a blog post there is no post/ which would be necessary for your code to act on. Furthermore, the blog overview page does not equal the custom post rewrite slug. You could use something ...


1

It looks that this code is very old. Function wp_start() is deprecated since WordPress 1.5 (Documentation). But you wanted to know how it code is counting so: $posts = get_posts('numberposts=6&offset=0'); - get 6 posts foreach ($posts as $post) : - iterate over each post static $count1 = 0; - initializes $count1 variable $count1++; - increase counter ...


1

Custom taxonomies have templates named taxonomy-something in this hierarchy: taxonomy-{taxonomy}-{term}.php taxonomy-{taxonomy}.php taxonomy.php archive.php index.php So, yes, if you have no taxonomy-custom-cat-term-cat.php, taxonomy-custom-cat.php or taxonomy.php then archive.php will be used. category-something.php will only be used for the built-in ...


1

You need to setup multiple meta_queries using an array. Since you didn't have a value you were looking for I'm just making sure that thePrice and thePrice2 are not blank. I set each meta query to a variable and then used them in the main orderby statement with a space between them. I wasn't able to do any testing on the code so if you have issues let me know....



Only top voted, non community-wiki answers of a minimum length are eligible