Forum Replies Created

Viewing 13 replies - 31 through 43 (of 43 total)
  • hi.
    you mean you need this to be an option of a theme?

    if not, something like this :

    <?php if (have_posts()) : while (have_posts()) : the_post();
    $post_types = array('1_type', '2_type', '3_type');
    foreach ( $post_types as $type ) {
    if( get_post_type() == $type ) {
    $icon = '<img src="'. get_bloginfo('template_directory') .'/images/'. $type . '_icon.png ';
       } echo $icon;
    }
     the_title(); // and your normal loop
    ?>

    name your icons – myPostType_icon.png

    if it won’t help, post your site link. i’ll see where’s your header img exactly

    well… in your style.css (or screen.css), (i don’t use this theme)) you’ll have:

    #wrapper, #access, #colophon, #branding, #main {
    width: 1100px;
    }

    change it for

    #wrapper, #access, #colophon, #main {
    width: 1100px;
    }
    #branding {
    width: 100%;
    }

    style.css
    look for #branding

    Hi.
    If i get it, you want:
    – sort of a private book ‘shelve’ per user?
    – the books are not posts

    again, if I get it right and it’s all is around a user, I’d think of using the user profile actions. I’d add an option page to the user admin area or just customize the native profile, adding whatever i need there: field groups, download buttons, ect.. it’ll insert the book data into a user db metadata so i’d have full control over the output based on a user id and i won’t need a plugin.

    Hi,
    Not to mess up with the code you could create a new menu at admin->Appearance->Menu. Add your new menu to the Primary Menu at Themes Locations. Save. Go a bit down the page, find Pages, click View All. You’ll see Home page there. Add it to your new menu and change Navigation Label to Blog.

    Hi!

    try
    background: url(‘images/my_background.png ‘);

    where ‘images’ is the folder sharing the same folder as your style.css file
    and my_background.png is the image (change png for gif or jpeg or what you have )

    Hi Eugene.chint
    did you try to set the width of the banner img div to percentage, 100% or whatever you need?
    sounds like what you have now is just set in px

    $folder = scandir( dirname(__FILE__). '/random_images' );
    $avs = array();
    	foreach( $folder  as $pic ) {
    		if( strpos($pic, '.') ! == 0 ) {
    			$avs[] = $pic; }
    	}
    	$n = rand(0, sizeof($avs)-1);
    	$avatar = '<a href="bla.."><img src="'. get_bloginfo('template_directory') . '/random_images/' . $avs[$n] . '"></a>';
            return $avatar;

    whatever ‘avatar_defaults’ is. i’d use the filter with wp core ‘get_avatar’

    indybook

    (@indybook)

    hi Jonathan.
    by ‘post type root’ you mean ‘parent category’ or ‘parent post’?
    the category hierarchy shows up fine for me both on single page and archive.
    is there ‘taxonomies’ and ‘hierarchical’ keys at your custom post type register function?

    Hi jonathantimar.
    it will break. the function uses woocommerce setting options as it looks. if no woo..oo.. endless plugin name… is installed there are no settings for it, right?

    try this. I’m not sure i’m being thorough enough and what things the site might have besides the lack of woocommerce. or what is the goal exactly. but this one works. let know if it won’t behave for you

    function limelight_breadcrumbs()	{
    			$delimiter = ' ? ';
    			$name = __("Home");
    			$currentBefore = ' <span class="current">';
    			$currentAfter = '</span> ';
    			$type=get_post_type();
    			if (!is_home() && !is_front_page() && get_post_type() == $type || is_paged()) {
    
    				echo '<nav id="breadcrumbs">';
    				global $post;
    				$home = get_bloginfo('url');
    				echo '<a href="' . $home . '">' . $name . '</a> ' . $delimiter . '';
    				if (is_category()) {
    					global $wp_query;
    					$cat_obj = $wp_query->get_queried_object();
    					$thisCat = $cat_obj->term_id;
    					$thisCat = get_category($thisCat);
    					$parentCat = get_category($thisCat->parent);
    					if ($thisCat->parent != 0) {
    						echo(get_category_parents($parentCat, true, '' . $delimiter . ''));
    					}
    					echo $currentBefore . single_cat_title() . $currentAfter;
    				}
    				else if (is_day()) {
    					echo '<a href="' . get_year_link(get_the_time('Y')) . '">' . get_the_time('Y') . '</a> ' . $delimiter . '';
    					echo '<a href="' . get_month_link(get_the_time('Y'), get_the_time('m')) . '">' . get_the_time('F') . '</a> ' . $delimiter . ' ';
    					echo $currentBefore . get_the_time('d') . $currentAfter;
    				} else if (is_month()) {
    					echo '<a href="' . get_year_link(get_the_time('Y')) . '">' . get_the_time('Y') . '</a> ' . $delimiter . '';
    					echo $currentBefore . get_the_time('F') . $currentAfter;
    				} else if (is_year()) {
    					echo $currentBefore . get_the_time('Y') . $currentAfter;
    				} else if (is_attachment()) {
    					echo $currentBefore;
    					the_title();
    					$currentAfter;
    				} if (is_single() && get_post_type() == $type ){
    					$cat = get_the_category();
    					$cat = $cat[0];
    					if ($cat !==NULL) {
    						echo get_category_parents($cat, true, ' ' . $delimiter . '');
    					}
    					echo $currentBefore;
    					the_title();
    					echo $currentAfter;
    				} else if (is_page() && !$post->post_parent) {
    					echo $currentBefore;
    					the_title();
    					echo $currentAfter;
    				} else if (is_page() && $post->post_parent) {
    					$parent_id = $post->post_parent;
    					$breadcrumbs = array();
    					while ($parent_id) {
    						$page = get_page($parent_id);
    						$breadcrumbs[] = '<a href="' . get_permalink($page->ID) . '">' . get_the_title($page->ID) . '</a>';
    						$parent_id = $page->post_parent;
    					}
    					$breadcrumbs = array_reverse($breadcrumbs);
    					foreach($breadcrumbs as $crumb)
    					echo $crumb . ' ' . $delimiter . ' ';
    					echo $currentBefore;
    					the_title();
    					echo $currentAfter;
    				} else if (is_search()) {
    					echo $currentBefore . __('Search Results For:','limelight') . ' ' . get_search_query() . $currentAfter;
    				} else if (is_tag()) {
    					echo $currentBefore . single_tag_title() . $currentAfter;
    				} else if (is_author()) {
    					global $author;
    					$userdata = get_userdata($author);
    					echo $currentBefore . $userdata->display_name . $currentAfter;
    				} else if (is_404()) {
    					echo $currentBefore . '404 Not Found' . $currentAfter;
    				}
    				if (get_query_var('paged')) {
    					if (is_home() || is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author()) {
    						echo  $currentBefore;
    					}
    					echo __('Page','limelight') . ' ' . get_query_var('paged');
    					if (is_home() || is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author()) {
    						echo $currentAfter;
    					}
    				}
    				echo '</nav>';
    			}
    		}

    ) Of course it does produce breadcrumbs, pretty proper.
    The mangle is good anyway. just check for the condition of *get_post_type != ‘post’. there it will generate a category archive link no matter if the page actually exists

    Hello jonathantimar,

    your function works perfectly fine site wide for any post type as soon as you change is_post_type for get_post_type() == $mypost_type and make the code check if a post has any category assigned to it before echoing its parent category – line … echo get_category_parents($cat, …..

    or I just got the question wrong. what exactly didn’t work?

Viewing 13 replies - 31 through 43 (of 43 total)