Is there any way of not using my_init_method in the following code (that creates a custom post type)?

What is the error message being generated? Also, to avoid conflicts, all custom Theme functions, classes, options, constants, etc. should be prefixed uniquely, e.g. using theme-slug. It is highly likely that a generic function name like my_init_method is used by another Plugin or Theme. Try renaming it to mytheme-slug_init_method. EDIT: To implement, rename your function … Read more

Get all active posts that are tied to a custom taxonomy for a custom post type

Here’s how I fixed it.. <!–faq page –> <div class=”faq”> <?php get_template_part(‘./template/global/breadcrumbs’); ?> <h3><span><?php the_title(); ?></span></h3> <?php $categories = get_categories(‘taxonomy=faqcat&order=DESC’); foreach ($categories as $cat) { $i = 0; ?> <div class=”faq-title”> <h2><?php echo $cat->name; ?></h2> </div> <?php $answers = new WP_Query(array(‘post_type’ => ‘faq’, ‘tax_query’ => array(array(‘taxonomy’ => ‘faqcat’, ‘field’ => ‘id’, ‘terms’ => $cat->term_id,),),)); if … Read more

What Is My Fault With This WP_QUERY ? [ Pagination Problem ]

I did! My new codes: <?php /** * Displays the Pagination in Custom loop * */?> <?php get_header(); ?> <?php global $wp_query; $aranan= $_GET[‘s’]; $kategorim = intval($_GET[‘cat’]); $kateg1= $_GET[‘kategorisec’]; if (intval($kateg1)<0) { $kateg = “”; } else { $kateg = $kateg1; } $myterm = get_term( $kategorim, ‘fgaleri’ ); global $myslug; $myslug = $myterm->slug; ?> <div … Read more

Front end post or photo or both

I’ve made a similar form before, and it works whether it has a post or not. This form does not use wp_editor, but you can just modify the code to suit your need. add_action(‘wp_ajax_add_story’, ‘process_story_entry’); function process_story_entry() { global $current_user; if ( empty($_POST) || !wp_verify_nonce($_POST[$current_user->user_login],’add_story’) ) { echo ‘You targeted the right function, but sorry, … Read more

How to get Custom post type by related category ID

After two days with this problem have resolved the problem, I fix it adding tax_query parameter with my taxonomy name and slug of the category requested: $args = array( ‘post_type’ => array ( ‘servicios’ => ‘servicios’, ), ‘tax_query’ => array( array( ‘taxonomy’ => ‘category’, ‘field’ => ‘slug’, ‘terms’ => ‘dgit’ ) ) );