Forum Replies Created

Viewing 8 replies - 16 through 23 (of 23 total)
  • Kountz,
    try moving the
    <?php $more = 0 ?>
    just after the while loop. it worked with me after long trials and errors.

    here my version of the loop for my custom Blog page

    <div id="content" class="narrowcolumn" role="main">
    	<?php global $more; ?>
    	<?php $my_query = new WP_Query('showposts=10');
    	while ($my_query->have_posts()) : $my_query->the_post(); ?>
    	<?php $more = 0; ?>
    		<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    			<div class="thumbnail">
    				<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><img src="<?php bloginfo('template_url') ?>/images/<?php echo get_post_meta($post->ID, 'post-thumbnail', true); ?>" width="200" height="200" alt="Post Image" /></a>
    			</div><!-- thumbnail ends -->
    			<div class="entry">
    				<h1 class="post-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
    				<small class="post-info"><strong>Posted: </strong><?php the_time('F jS, Y') ?> in <?php the_category(', ') ?> by <?php the_author() ?></small>
    				<div class="post-desc">
    					<?php the_content('Read more'); ?><span class="post-comments"><?php comments_popup_link('0 Comments', '1 Comment', '% Comments'); ?></span>
    				</div>
    			</div>
    		</div><!-- post ends -->
    	<?php endwhile; ?>
    	</div><!-- content ends -->

    [signature moderated Please read the Forum Rules]

    Thread Starter MAD000

    (@mad000)

    Gangleri,
    <span> is used to display a background image for the comments link. It acts like a button.

    Any ideas why the “Read more” won’t show in the post ?

    Can u explain how you resolved the issue. Which version of IE are using?

    Daniel,
    use the following css to style your menu:

    #my-menu {
    	background: transparent url('images/bg_mainmenu.jpg');
    	width: 1124px;
    	height: 35px;
    text-align: center;
    }
    
    #my-menu .current_page_item {
    	background-color: black;
    }
    
    #my-menu li:hover {
    	background-color: white;
    }
    
    #my-menu ul {
    padding: 7px;
    }
    
    #my-menu li {
    display: inline;
    	list-style: none;
    	font-family: Verdana;
    	font-size: 14px;
    	text-align: center;
    	padding: 7px;
    }
    
    #my-menu a {
    	text-decoration: none;
    	color: black;
    }

    This should display the menu in the center.

    MAD from https://flashjourney.com/

    Hi all,
    I have been trying to find a simpler, more efficient way to display different posts depending on different conditions. For now I wrote the following script to retrieve posts for a specific category named ‘Inspiration’ and that should be displayed in descending order based on the number of comments (popularity). I would welcome any suggestions to shorten this (I feel there is another way!!)
    here is the code:

    <div class="inspirational-post-box"><!-- start -->
    <h1 class="heading-small">Inspirational Posts</h1>
    <?php $sql = "SELECT * "
    	. "FROM $wpdb->posts AS p "
    	. "WHERE p.post_status = 'publish' "
    	. "AND p.post_type = 'post' "
    	. "AND p.ID IN (SELECT tr.object_id "
    	. "FROM $wpdb->term_relationships tr "
    	. "WHERE tr.term_taxonomy_id IN (SELECT tt.term_taxonomy_id FROM wp_term_taxonomy AS tt "
    	. "INNER JOIN $wpdb->terms AS t ON t.term_id = tt.term_id "
    	. "WHERE (tt.term_id = (SELECT tt.term_taxonomy_id "
    	. "FROM $wpdb->term_taxonomy AS tt "
    	. "INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id "
    	. "WHERE tt.taxonomy = 'category' AND t.name = 'Inspiration') OR tt.parent = (SELECT tt.term_taxonomy_id "
    	. "FROM $wpdb->term_taxonomy AS tt "
    	. "INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id "
    	. "WHERE tt.taxonomy = 'category' AND t.name = 'Inspiration')))) "
    	. "ORDER BY p.comment_count DESC LIMIT 12";
    $result = $wpdb->get_results($sql);
    foreach ($result as $post) {
    setup_postdata($post);
    ?>
    <div class="entry-small">
    <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><img class="thumbnail-small" src="<?php bloginfo('template_url') ?>/images/<?php echo get_post_meta($post->ID, 'post-thumbnail', true); ?>" width="50" height="50" alt="Small Thumbnail" /></a>
    <h2 class="title-small">
    <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a>
    </h2>
    </div>
    <?php } ?>
    </div><!-- end -->

    [signature moderated Please read the Forum Rules]

    Hi Daniel,
    you can use the following script for the pages menu:

    <div id="my-menu">
    <?php wp_page_menu('show_home=1'); ?>
    </div><!-- my-menu ends -->

    The above code will show a menu of all blog pages including home page.

    The css for this depends on your theme color and sizes, but try this:

    #my-menu {
    	float: left;
    	width: 1020px;
    	height: 35px;
    }
    
    #my-menu .current_page_item {
    	background-color: lightred;
    }
    
    #my-menu li:hover {
    	background-color: darkblue;
    }
    
    #my-menu li {
    	float: left;
    	list-style: none;
    	font-family: Verdana;
    	font-size: 14px;
    	text-align: center;
    	height: 28px;
    	padding-top: 7px;
    	padding-left: 5px;
    	padding-right: 5px;
    }
    
    #my-menu a {
    	text-decoration: none;
    	color: #8D95CD;
    }

    [signature moderated Please read the Forum Rules]

    I tried the same and it did not work, here is my CSS:

    * {
    	margin: 0;
    	padding: 0;
    }
    
    body {
    	font-family: Verdana, 'Lucida Grande', Verdana, Arial, Sans-Serif;
    	text-align: center;
    	background: url(images/bg.jpg) repeat-x #EDEDED;
    	font-size: 14px;
    	color: #000;
    }
    
    ul {
    	list-style-type: none;
    }
    
    a, a:visited {
    	text-decoration: none;
    	color: #000;
    }
    
    a:hover {
    	text-decoration: underline;
    }
    
    a img {
    	border-style: none;
    }
    
    #page {
    	width: 1020px;
    	margin: 0 auto;
    }

    I am still trying to finish up my new Theme, it looks fantastic on Fire Fox (best browser). I still have to tackle the many IE (all versions, even 8!!) issues.

    [signature moderated Please read the Forum Rules]

    Thanks for code I was looking for something similar to put in our new theme for https://flashjourney.com/ that will be launched soon.

    I took your code and tweaked it a little bit. You can use the following to get the siblings of the current category:

    <br />
    <?php<br />
    if (is_category()) {<br />
    $this_category = get_category($cat);<br />
    if (get_category_children($this_category->cat_ID) != "") {<br />
    wp_list_categories('hide_empty=0&title_li=&child_of=' . $this_category->cat_ID);<br />
    }<br />
    else {<br />
    $parent = $this_category->category_parent;<br />
    echo "children of " . $parent . ": ";<br />
    wp_list_categories('hide_empty=0&title_li=&child_of=' . $parent);<br />
    }<br />
    }<br />
    ?><br />

    [signature moderated Please read the Forum Rules]

Viewing 8 replies - 16 through 23 (of 23 total)