Forum Replies Created

Viewing 15 replies - 301 through 315 (of 347 total)
  • I suppose you understand template hierarchy.
    https://developer.wordpress.org/themes/basics/template-hierarchy/

    Since there is not category.php nor archive.php, WordPress use index.php for displaying category archive page.
    However, index.php is user for other pages like top page, tag pages and 404 page, if there are not appropreate template.
    And because contents need to be different in each page, there are conditional statement in index.php, like if($is_404 == true) or if(is_category()).

    Now, provided that you prepared child theme, copy index.php of parent theme to child theme directory, and rename it to category.php.
    This category.php is gonna be specific template for category archive pages only, so you don’t need if($is_404 == true) block or if(is_category()) wrap.
    ( You can delete line 2-4, too.

    /*
      Template Name: Home page
     */

    These lines are kind of odd to be here, but anyway.)

    As for code I was talking to add after line 198, that can be anything you want.
    If you want to show category description, just paste the following:

    <?php echo category_description(); ?>

    Forum: Themes and Templates
    In reply to: SEARCH BOX

    First of all, it is recommended to use child theme, before customizing themes.
    http://codex.wordpress.org/Child_Themes

    As for “search” text, look for header.php for the following:
    <input type="search" class="search-field" placeholder="Search …" value="" name="s" title="Search for:">
    Placeholder attribute is what you are looking for.

    As for colors, it is in site-banner.css.

    It is good to use Chrome developer tool for finding which styles to change.

    Forum: Hacks
    In reply to: Adding JS to child theme

    You are welcome.

    There is an error remains on scrolling-nav.js.

    Just wrap whole code inside the following:

    (function($){
    //paste original code here
    })(jQuery);

    This should fix it.

    Forum: Hacks
    In reply to: Adding JS to child theme

    It is OK to place script in footer.php.
    But it seems <!-- Scrolling Scripts for Fixed Nav --> is located after your footer script tags. That is the problem. It must be loaded beforehand.

    <!-- Scrolling Scripts for Fixed Nav -->
    	<script type="text/javascript" src="http://www.jakecreative.guru/wp-content/cache/minify/000000/nc5LDoAgDEXRDVlhS4gvWOSjLZi4ezVxBUzv4ORaI9CjFuULlOvCCRTdDvIC174YunTyG6eV2oYME9XEs0PuGU65hDlzmeyQo15qSq9BxV2Dxv-ijf1-Pw.js"></script>

    It would be better to turn off W3 Total Cache plugin for checking bugs.

    Forum: Hacks
    In reply to: Adding JS to child theme

    Hi JakeCr8Guru.
    It seems <?php wp_footer(); ?>` is not set before your footer scripts.
    wp_footer() handles enqueued scripts for footer area, and it is usually set right before closing body tag.

    However, you need those plugin js before your inline footer scripts, so put <?php wp_footer(); ?> before script tags.

    Forum: Hacks
    In reply to: Adding JS to child theme

    You have three functions with same name.
    How about putting them in one function:

    function my_scripts_method() {
    	wp_enqueue_script( 'sticky-menu', get_stylesheet_directory_uri() . '/js/jquery.sticky.js', array( 'jquery' ), true );
    	wp_enqueue_script( 'scrolling-menu', get_stylesheet_directory_uri() . '/js/scrolling-nav.js', array( 'jquery' ), true );
    	wp_enqueue_script( 'easinging-menu', get_stylesheet_directory_uri() . '/js/jquery.easing.min.js', array( 'jquery' ), true);
    }
    
    add_action( 'wp_enqueue_scripts', 'my_scripts_method' );

    Note that above function should be in functions.php of child theme.

    It is written in index.php.
    Loop starts at line 181.

    If you want to add content after thumbnails, you can add code after line 198.

    However, it is recommended to make Child theme to customize theme.
    https://codex.wordpress.org/Child_Themes

    How about using jQuery load() method?
    http://api.jquery.com/load/

    Slider can be enabled or disabled by checking checkbox, which is in Appearance > Inkness Settings > Slider Settings tab.

    If above checkbox is checked, nivo.slider.js is enqueued in functions.php around line 133.

    content-home.php is called in home.php line 32:
    get_template_part( 'content', 'home' );

    This command search for content-home.php first, and if none, search for content.php next.

    If taxonomy-type.php is the correct file to edit, there is ‘type’ taxonomy which has terms ‘security’ and ‘Conference’.
    Also, you have ‘tribe_events_cat’ custom field which has ‘security’ and ‘Conference’ as values?

    Anyway, how this works?

    <?php
    $args = array(
    	'post_type' => 'tribe_events',
    	'posts_per_page' => -1,
    	'tax_query' => array(
    		'relation' => 'AND',
    		array(
    			'taxonomy' => 'eventDisplay',
    			'field'    => 'slug',
    			'terms'    => array( 'past' ),
    		),
    		array(
    				'relation' => 'AND',
    				array(
    					'taxonomy' => 'type',
    					'field'    => 'slug',
    					'terms'    => array( 'security' ),
    				),
    				array(
    					'taxonomy' => 'type',
    					'field'    => 'slug',
    					'terms'    => array( 'Conference' ),
    					'operator' => 'NOT IN',
    				),
    		),
    	),
    );
    $wp_query = new WP_Query( $args );
    ?>

    Yes, terminology is a bit complicated.
    Let’s check them out.

    If you find ‘tribe_events_cat’ menu under ‘tribe_events'( or Tribe Events or some sort) menu in admin side menus, ‘tribe_events_cat is custom taxonomy.

    If ‘Conference’ and ‘security’ are in Posts > Categories, they are categories.

    If you don’t find them in above place, and you set values for them in each post editting page, they might be a custom field values.

    Same for ‘eventDisplay’.

    Here are questions:

    1. Which type are they? Custom taxonomy, Category, or custom field?

    2. Which template file your code is in?

    3. Is tribe_events_cat hierarchical? ( Is ‘Conference’ the parent of ‘security’, or they are siblings?)

    It depends on how you implemented “category”, in order to get desired query.
    I need the following information.

    1. Which do you use for Conference and security: category or custom taxonomy or something else?
    ( “tribe_events_cat” seems to be a custom taxonomy name. )

    2. Also, what about for eventDisplay? Is it a custom taxonomy or custom field or something else?

    Sorry, you need different size for thumbnails.

    <?php if ( have_posts()) : ?>
    	<?php while ( have_posts()) : the_post(); ?>
    		<div>
    		<?php if (is_first_two_posts()) {
    			// for big thumbnails
    		} else {
    			// for small thumbnails
    		}
    		?>
    		</div>
    	<?php endwhile; ?>
    <?php else : ?>
    <?php endif; ?>

    I thought you want to achieve only with css.

    How about this.

    In functions.php:

    function is_first_two_posts(){
    	global $wp_query;
    	return ( $wp_query->current_post === 0 || $wp_query->current_post === 1 );
    }

    And template:

    <?php if ( have_posts()) : ?>
    	<?php while ( have_posts()) : the_post(); ?>
    		<div class="<?php if (is_first_two_posts()) { echo 'big-thumb'; } ?>">
    		// Your code here
    		</div>
    	<?php endwhile; ?>
    <?php else : ?>
    <?php endif; ?>

    Try the following.
    Presuming eventDisplay and tribe_events_cat are custom taxonomy.
    If they are custom field values, you need to use custom field parameters: See Codex http://codex.wordpress.org/Function_Reference/WP_Query#Custom_Field_Parameters

    Updated: in case you have posts in both security and Conference categories.

    <?php
    $args = array(
    	'post_type' => 'tribe_events',
    	'posts_per_page' => -1,
    	'tax_query' => array(
    		'relation' => 'AND',
    		array(
    			'taxonomy' => 'eventDisplay',
    			'field'    => 'slug',
    			'terms'    => array( 'past' ),
    		),
    		array(
    				'relation' => 'AND',
    				array(
    					'taxonomy' => 'tribe_events_cat',
    					'field'    => 'slug',
    					'terms'    => array( 'security' ),
    				),
    				array(
    					'taxonomy' => 'tribe_events_cat',
    					'field'    => 'slug',
    					'terms'    => array( 'Conference' ),
    					'operator' => 'NOT IN',
    				),
    		),
    	),
    );
    $wp_query = new WP_Query( $args );
    ?>

Viewing 15 replies - 301 through 315 (of 347 total)