If/Else not working for header

You actually doing mistake. You have to pass 3 parameters as array not like this. Use below code <?php //if is single event, guide, firm news if ( is_singular( array(‘events’,’guide’,’firm-news’) ) ) : ?> <h5 class=”event-subpage-header-title”><?php echo $title; ?></h5> <?php else : ?> <h1><?php echo $title; ?></h1> <?php endif; ?>

Display ONLY ONE $term (Out of 4 terms) from a Custom Taxonomy and CPT

OK, so finally after searching for days i was able to solve my problem!! Just had to remove these two lines of code: $terms = wp_get_post_terms( $post->ID, ‘service_cat’ ); foreach($terms as $term) { With this line instead: $term = get_term_by( ‘slug’, get_query_var( ‘term’ ), get_query_var( ‘taxonomy’ ) ); And that solved my issue!! Thanks also … Read more

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