virgild
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Static page with recent blog postsyes, I fixed it.
Forum: Themes and Templates
In reply to: Static page with recent blog postsThank you so much! It works. I can even add the_excerpt ??
I hope I’m not asking too much (I probably am..) but here goes another question… I wouldn’t ask this much but I have been trying to fix this for 2 hours now and I just can;t figure it out.. I’m new to php ??
So.. to my singlepost.php I added this to the author meta tag
<?php printf(__('Written by %1$s in %2$s'),'<a href="'. get_author_posts_url(get_the_author_ID()) .'" title="'. sprintf(__("Posts by %s"), attribute_escape(get_the_author())).' ">'. get_the_author() .'</a>',$category_link); ?>
so it will take you to all the posts by the author.
Then I made.. actually borrowed a php from another theme called author.php
<?php /* Mystique/digitalnature */ get_header(); ?> <!-- main content: primary + sidebar(s) --> <div id="main"> <div id="main-inside" class="clearfix"> <!-- primary content --> <div id="primary-content"> <?php // global $wp_query; // $curauth = $wp_query->get_queried_object(); if(isset($_GET['author_name'])): $curauth = get_userdatabylogin($author_name); else : $curauth = get_userdata(intval($author)); endif; ?> <h1 class="title"><?php echo $curauth->display_name; ?></h1> <div class="clearfix"> <div class="alignleft"><?php echo get_avatar($curauth->user_email, '128', $avatar); ?></div> <div> <p> <?php if($curauth->user_description<>''): echo $curauth->user_description; else: _e("This user hasn't shared any biographical information","mystique"); endif; ?> </p> <?php if(($curauth->user_url<>'https://') && ($curauth->user_url<>'')) echo '<p class="im www">'.__('Homepage:','mystique').' <a href="'.$curauth->user_url.'">'.$curauth->user_url.'</a></p>'; if($curauth->yim<>'') echo '<p class="im yahoo">'.__('Yahoo Messenger:','mystique').' <a href="ymsgr:sendIM?'.$curauth->yim.'">'.$curauth->yim.'</a></p>'; if($curauth->jabber<>'') echo '<p class="im gtalk">'.__('Jabber/GTalk:','mystique').' <a href="gtalk:chat?jid='.$curauth->jabber.'">'.$curauth->jabber.'</a></p>'; if($curauth->aim<>'') echo '<p class="im aim">'.__('AIM:','mystique').' <a href="aim:goIM?screenname='.$curauth->aim.'">'.$curauth->aim.'</a></p>'; ?> </div> </div> <div class="divider"></div> <br /> <?php if (have_posts()): ?> <h3 class="title"><?php printf(__('Posts by %s', 'mystique'), $curauth->display_name); ?></h3> <div class="divider"></div> <?php while (have_posts()): the_post(); include(TEMPLATEPATH . '/post.php'); endwhile; ?> <div class="page-navigation clearfix"> <?php if(function_exists('wp_pagenavi')): wp_pagenavi(); else: ?> <div class="alignleft"><?php next_posts_link(__('« Older Entries','mystique')) ?></div> <div class="alignright"><?php previous_posts_link(__('Newer Entries »','mystique')) ?></div> <?php endif; ?> </div> <?php else : ?> <p class="error"><?php _e('No posts found by this author.','mystique'); ?></p> <?php endif; ?> </div> <!-- /primary content --> <?php get_sidebar(); ?> </div> </div> <!-- /main content --> <?php get_footer(); ?>
..and there’s a
include(TEMPLATEPATH . '/post.php');
in that code. The post.php is the code you gave me
<?php $args=array( 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => 5, 'caller_get_posts'=> 1 ); $my_query = null; $my_query = new WP_Query($args); if( $my_query->have_posts() ) { echo 'List of Posts'; while ($my_query->have_posts()) : $my_query->the_post(); ?> <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p> <?php the_excerpt(__('Read more'));?> <?php endwhile; } wp_reset_query(); // Restore global post data stomped by the_post(). ?>
It takes you to the author page and shows all posts by the author but the “list of posts” appears two times. I don’t know what to erase to have the list appear just once.
Forum: Themes and Templates
In reply to: Static page with recent blog postsThank you for teh code! I added it and I get a list. I tried adding the_content but nothing happens. This is the page template
<?php /* Template Name: Homepage */ get_header(); ?> <div id="content"> <div class="post"> <?php $args=array( 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => 5, 'caller_get_posts'=> 1 ); $my_query = null; $my_query = new WP_Query($args); if( $my_query->have_posts() ) { echo 'List of Posts'; while ($my_query->have_posts()) : $my_query->the_post(); ?> <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p> <?php endwhile; } wp_reset_query(); // Restore global post data stomped by the_post(). ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <h2><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2> <?php the_content(__('Read more'));?> <?php endwhile; else: ?> <p><strong>There has been a glitch in the Matrix.</strong><br /> There is nothing to see here.</p> <p>Please try somewhere else.</p> <?php endif; ?> </div><!-- end #post--> </div><!-- end #content--> <?php get_sidebar(); ?> <?php get_footer(); ?>
Not sure what I’m doing wrong there..
Forum: Plugins
In reply to: plugin for featured post slideshow?thanks! I wasn’t searching the right key words..
Forum: Fixing WordPress
In reply to: different image on each pagethis is not a bump..
Forum: Fixing WordPress
In reply to: how to hide sub-pages from showingthanks! that work. I’ll study the codex.
Forum: Fixing WordPress
In reply to: how to hide sub-pages from showingThanks that worked!
do you know how remove the text “pages” in the beginning of the page links? I don’t know why it shows up.
Forum: Fixing WordPress
In reply to: how to hide sub-pages from showingI tried pasting it under <div id=”headernav”>
but a duplicate navigation appears above the original
Forum: Fixing WordPress
In reply to: how to hide sub-pages from showingI’m too embarrassed to show it lol.. may I paste the header php?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="https://www.w3.org/1999/xhtml" <?php language_attributes(); ?>> <head profile="https://gmpg.org/xfn/11"> <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> <title><?php wp_title('|', true, 'right'); ?> <?php bloginfo('name'); ?> <?php if ( !wp_title('', true, 'left') ); { ?> | <?php bloginfo('description'); ?> <?php } ?></title> <meta name="generator" content="WordPress" /> <!-- leave this for stats (or remove for potential security reasons) --> <meta name="author" content="Brian Purkiss" /> <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" /> <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" /> <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> <?php wp_head(); ?> </head> <body> <div id="container"> <div id="headernav"> <?php wp_page_menu(); ?> </div><!-- end #topNav --> <div id="banner"> <?php $content = "[smooth=id: 1; width:825; height:284; timed:true; arrows:false; carousel:false; links:false; info:false; align:center; frames:false; delay:2000; transition:fade;]"; smooth_show($content); ?> </div> <div id="header"> <div class="title"> <h3><a href="<?php echo get_option('home'); ?>/" title="<?php bloginfo('description'); ?>"><?php bloginfo('name'); ?></a></h3> <h4><p><?php bloginfo('description'); ?></p></h4> </div> <div class="searchbar"> <?php include (TEMPLATEPATH . '/searchform.php'); ?> </div> </div><!-- end #header -->
Forum: Fixing WordPress
In reply to: how to hide sub-pages from showingThanks for responding!
The problem is that I can’t find the code. I looked in all .php. I think I have to add it but I don’t know where exactly. I tried but nothing happens..
Forum: Fixing WordPress
In reply to: why is a scroll bar appearing on my website?lol, sorry my post had vanished in the depths..
Thanks for the help! overflow:hidden did the trick ??
Forum: Fixing WordPress
In reply to: why is a scroll bar appearing on my website?bump