Modify category archive page loop on functions.php
Modify category archive page loop on functions.php
Modify category archive page loop on functions.php
Have just tweaked your code to achieve what you need. See, if this works for you – $taxonomyName = “age”; $parent_terms = get_terms($taxonomyName, array(‘parent’ => 0, ‘orderby’ => ‘slug’, ‘hide_empty’ => false)); echo ‘<ul>’; foreach ($parent_terms as $pterm) { $terms = get_terms($taxonomyName, array(‘parent’ => $pterm->term_id, ‘orderby’ => ‘slug’, ‘hide_empty’ => false)); foreach ($terms as $term) … Read more
At first blush, your code looks solid. Two suggestions: 1) Try putting the longer rewrite rule before the shorter one. It’s possible that the first one is being matched (because it is a subset of the longer one) and then not proceeding to check the longer one. 2) Whenever you modify rewrite rules, you have … Read more
I have been working with a plugin called TM Extra Product Options and I am fairly sure you could achieve your goals using that. It isn’t the prettiest plugin from a UI perspective, but it has a lot of functionality and good support if you use their forums. You could use a select box for … Read more
Here is one approach: $myrows = $wpdb->get_results( “SELECT first_name, surname, role, email, country, bio FROM members” ); foreach ( $myrows as $row ) { $first_name = $row->first_name; if ( ! empty( $row->bio ) ) { $first_name=”<a href=”#”>” . $first_name . ‘</a><div class=”bio” style=”display: none;”>’ . $row->bio . ‘</div>’; } echo “<tr><td>” . $first_name . “</td><td>” … Read more
Okay I hate it when I just figure it out after I post the question. But it seems each post can have a number of attachments. Which means each attachment has an ID associated with it. Which was confusing because it shared the same ID style and type as the post. The following code is … Read more
Yes, you can include a check for is_home() or is_front_page() and return a different title based on that. Update: TwentyEleven does it like this for example (lines 27 to 45).
At first glance, you’re assigning values to get_current_blog_id instead of comparing them. That is get_current_blog_id() = 1 should be get_current_blog_id() === 1 in both places.
I have write : <?php $blog_id = get_current_blog_id(); ?> <?php if( 1 == $blog_id ); ?> <div id=””><script src=””></script><script src=”” ></script></div> <?php elseif( 2 == $blog_id ): ?> <div id=””><script src=””></script><script src=”” ></script></div> <?php else: ?> Default script <?php endif; ?> It correct !?
I have added the style “background-position: center center;” and it work perfectly! So the new code will look like this: <?php global $post; $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), array( 5600,1000 ), false, ” ); ?> <div class=”mainblogwrapper” style=”background-image: url(<?php echo $src[0]; ?> ) !important; background-attachment : fixed;background-position: center center;”>