• I want to Make abc-z links availble to users for sorted album/artist list..

    what do i do?? shall i make categories?
    or anything else..
    For example check this site ,it is having an ideal linking which i want
    http://www.hindilyrix.com/
    Help me..how to get those linked a,b,c,….z to my every post in a sorted method ..

    Thanks in adv

Viewing 15 replies - 1 through 15 (of 28 total)
  • Thread Starter funrockerz

    (@funrockerz)

    all went over my head :(…

    what’s the problem?

    Thread Starter funrockerz

    (@funrockerz)

    dont know which to paste in which file.. white screen comes whenever i experiment

    I came across this topic just now, please take a look. I think that this could help you achieve your goals.

    http://wordpress.org/support/topic/a-z-index-list-of-tags?replies=20 and there was another floating around as well http://wordpress.pastebin.ca/1764165

    One or the other, this will be the starting point for you.

    Cheers,
    Emil

    Thread Starter funrockerz

    (@funrockerz)

    This does exactly what you asked for. Just copy the code into a new file and save it as “t-tags.php” in your current themes directory. You will then need to log into WordPress, create a new page and apply the “Tags” Template to it. You may also need to change the html under “OUTPUT” to match your theme. Please don’t change anything under “Process” unless it makes sense to you 🙂

    <?php
    /*
    Template Name: Tags
    */
    
    	/* Process
    	================================================= */
    	$list = '';
    	$tags = get_terms( 'post_tag' );
    	$groups = array();
    	if( $tags && is_array( $tags ) ) {
    		foreach( $tags as $tag ) {
    			$first_letter = strtoupper( $tag->name[0] );
    			$groups[ $first_letter ][] = $tag;
    		}
    		if( !empty( $groups ) ) {
    			foreach( $groups as $letter => $tags ) {
    				$list .= "\n\t" . '<h2>' . apply_filters( 'the_title', $letter ) . '</h2>';
    				$list .= "\n\t" . '<ul>';
    				foreach( $tags as $tag ) {
    					$url = attribute_escape( get_tag_link( $tag->term_id ) );
    					$count = intval( $tag->count );
    					$name = apply_filters( 'the_title', $tag->name );
    					$list .= "\n\t\t" . '<li><a href="' . $url . '">' . $name . '</a> (' . $count . ')</li>';
    					}
    				$list .= "\n\t" . '</li>';
    			}
    		}
    	}else $list .= "\n\t" . '<p>Sorry, but no tags were found</p>';
    
    	/* OUTPUT
    	============================= */
    	get_header();
    	?>
    	<div id="container">
    	<div id="main">
    	<?php print $list; ?>
    	</div>
    	</div><!-- end main -->
    	<?php
    	get_sidebar();
    	get_footer();
    	?>

    he said create a new page and apply the “Tags” Template to it…How to apply “Tags” Template to that page??
    and what output to change..

    please explain

    So the code above (from what I can understand) needs to be saved as: t-tags.php. Upload that saved file to your site.

    1. Save the above as t-tags.php in wp-content/themes/yourtheme
    2. Upload via FTP to your site
    3. Login to WordPress and create new page (name it the way you need)
    4. Apply “Tags” see http://i.imgur.com/RDY3Q.jpg

    That’s all.

    Emil

    Thread Starter funrockerz

    (@funrockerz)

    Yes it started Showing the List by tags..

    http://songlyricsz.com/lyrics-list Take a look at that..

    But few points –

    1. how to show entire a-z list in home page ..
    2. by clicking on one tag in that list it should show just posts titles rather than showing entire posts at once..
    3. why every character is showing with +1 tab space
    1. http://codex.wordpress.org/Function_Reference/get_template_part – <?php get_template_part( ‘t-tags’ ); ?> – and include in your home page
    2. Check your tag.php file, if you don’t have one, create it http://codex.wordpress.org/Tag_Templates#Examples and “shorten the content or display titles only
    3. t-tags.php was an example only, you will need to style this template to include the same look as in your current theme

    For instance t-tags.php has <div id=”main”> on your site you have <div id=”content”> so things like that needs to be changed.

    Thread Starter funrockerz

    (@funrockerz)

    1. Sorry by putting that code in home page its showing everything it has in that lyrics page ..i just want that abcdefg…..z hyper-linked ..and
    how do i adjust every character to different page..
    2.i already have tags.php…your given link said

    you will just need to find where it says the_content() inside The Loop in your Template, and replace it with the_excerpt().

    in that i just found this..<?php the_content("Read the rest of this entry");?> but by changing it to excerpt nothing changes ..

    3. case solved..i changed the output to this`/* OUTPUT
    ============================= */
    get_header();
    ?>
    <div class=”fContent2″>
    <div>
    <?php print $list; ?>
    </div>
    </div><!– end main –>
    <?php
    get_sidebar();
    get_footer();
    ?>`
    and also in process part i deleted one ul code

    Thread Starter funrockerz

    (@funrockerz)

    Here is my tags.php

    <?php
    /*
    Template Name: tagspage
    */
    ?>
    
    <?php get_header ();?>
        	<div class="cWrap">
                <div class="leftCol" id="leftCol">
                	<?php
    				if (have_posts()) :
    					while (have_posts()) : the_post();
    				?>
                    <div class="clear"></div>
                    <div class="post-wrapper">
                        <!-- loop start-->
                        <div class="post" id="post-<?php the_ID(); ?>">
                            <div class="post_info">
                            	<h1><?php the_title(); ?></h1>
                                <div class="nCat">
                                    <p><strong>Written</strong> by <?php the_author_posts_link() ?> on <?php the_time("l, F d, Y")?> | <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); edit_post_link('Edit', ' | ', ''); ?></p>
                                    <p>
                                    	<strong>Categories:</strong> <?php the_category(', ') ?><?php the_tags('&nbsp;&nbsp;&nbsp;<strong>Tags:</strong> ', ', ', ''); ?>
                                    </p>
                                </div>
                                <div class="clear"></div>
                            </div>
    
    						<?php if ( function_exists('wp_tag_cloud') ) : ?>
    <div style="margin:25px;border:1px solid #111;padding:15px;">
    <ul  style="margin:0 0 0 8px;padding:0;">
    <?php wp_tag_cloud('smallest=8&largest=24&number=0'); ?>
    </ul>
    </div>
    <?php endif; ?>
    
                            <div class="clear"></div>
                            <div class="postdetail">
                                <?php the_content("Read the rest of this entry");?>
                                <div class="clear"></div>
                            </div>
                        </div>
                    </div>
    
    				<?php  ?>
    				<?php
    					endwhile;
    				else :
    				?>
                    <div class="boxHeading">
                        <h1>Nothing Found</h1>
                    </div>
                    <div class="clear"></div>
                    <div class="post-wrapper">
                        <!-- loop start-->
    
                        <div class="post" id="error-404">
                            <div class="clear"></div>
                            <div class="postdetail">
                                <p>Sorry but the page you are looking for cannot be found.</p>
                                <p>If you're in denial and think this is a conspiracy that cannot possibly be true, please try using my search box below.</p>
                                <div class="clear"></div>
                            </div>
                        </div>
    
                    </div>
    				<?php
    				endif; ?>
    			</div>
    			<?php get_sidebar ('left');?>
            </div>
    		<?php get_sidebar ();?>
            <div class="clear"></div>
        </div>
    <?php get_footer (); ?>

    Absolutely, so this is what we need to do:

    In your tags.php locate:

    <div class="postdetail">
    <?php the_content("Read the rest of this entry");?>
    <div class="clear"></div>
    </div>

    and replace with:

    <div class="postdetail">
    <?php the_excerpt();?>
    <div class="clear"></div>
    </div>

    Now you need to check if you have the_excerpt() in place, if not create one in functions.php:

    function new_excerpt_length($length) {
    	return 20;
    }
    add_filter('excerpt_length', 'new_excerpt_length');

    Also refer to:

    http://codex.wordpress.org/Function_Reference/the_excerpt#Control_Excerpt_Length_using_Filters

    Thread Starter funrockerz

    (@funrockerz)

    <?php
    $theme_settings = get_option("blogsetings");
    $more_new_link = "";
    if ( function_exists('register_sidebar') ):
    	register_sidebar(array(
    		'name' => 'Sidebar',
    		'before_widget' => '<div id="%1$s" class="widget %2$s">',
    		'after_widget'  => '<div class="clear"></div></div></div>',
    		'before_title'  => '<div class="widget-heading"><h3>',
    		'after_title'   => '</h3></div><div class="widget_body">',
    	));
    	register_sidebar(array(
    		'name' => 'SidebarRight',
    		'before_widget' => '<div id="%1$s" class="widget2 %2$s">',
    		'after_widget'  => '<div class="clear"></div></div></div>',
    		'before_title'  => '<div class="widget-heading"><h3>',
    		'after_title'   => '</h3></div><div class="widget_body">',
    	));
    endif;
    
    define ("blogdir", 			get_bloginfo("template_directory") . "/");
    define ("blogimages", 		blogdir . "images/");
    define ("home", 			get_bloginfo('url'). "/");
    define ("blogname", 		get_bloginfo("name"));
    define ("blogdesc", 		get_bloginfo("description"));
    define ("pubid", 			$theme_settings[settings][publisher_id]);
    if (is_array($theme_settings["featured_cats"])){
    	define ("featured_categories", implode(",", $theme_settings["featured_cats"]));
    }
    
    //	this function adds the settings page to the Appearance tab
    add_action('admin_menu', 'add_theme_options_menu');
    function add_theme_options_menu() {
    	add_submenu_page('themes.php', blogname . ' Theme Settings', 'Options', 8, 'blog-options', 'theme_settings_admin');
    }
    
    function theme_settings_admin() { ?>
    <?php theme_options_css_js(); ?>
    <div class="wrap">
    <?php
    	// display the proper notification if Saved/Reset
    	global $theme_settings, $defaults, $rpt;
    	if ( $_REQUEST['saved'] ) echo '<div id="message" class="updated fade"><p><strong>Blog Settings Saved.</strong></p></div>';
    	if ( $_REQUEST['reset'] ) echo '<div id="message" class="updated fade"><p><strong>Blog Settings Reset.</strong></p></div>';
    	// display icon next to page title
    	screen_icon('options-general');
    	//echo "<pre>" . print_r($theme_settings, true) . "</pre>";
    ?>
    	<h2>Theme Settings</h2>
    	<form method="post" action="themes.php?page=blog-options" id="blog-options">
    	<?php // first column ?>
    	<div class="metabox-holder">
    		<div class="postbox">
    			<h3>Advertisement / Blog Setting</h3>
    			<div class="inside">
                	<p style="margin:10px 0 0">Publisher ID:<br />
    				<input type="text" name="blogsetings[settings][publisher_id]" value="<?php echo $theme_settings[settings][publisher_id]; ?>" size="30" /></p>
    				<p>
                    	Select Categories to be show on Home Page:<br />
                        <?php
    					$cats = wp_dropdown_categories('name=blogsetings[featured_cats_home][]&class=catOption&hierarchical=1&hide_empty=0&echo=0');
    					$cats = str_replace('<select ', '<select multiple="multiple" ', $cats);
    					$fcats = $theme_settings[featured_cats_home];
    					if (is_array ($fcats)):
    						foreach ($fcats as $cid):
    							$cats = str_replace('value="' . $cid . '"', 'value="' . $cid . '" selected="selected"', $cats);
    						endforeach;
    						echo $cats;
    					else:
    						echo $cats;
    					endif;
    					?>
                    </p>
                </div>
    		</div>
    	</div>    
    
    	<?php // end first column ?>
    
    	<?php // second column ?>
    
    	<div class="metabox-holder">
    
    		<div class="postbox">
    			<h3>Style / Featured Categories</h3>
    			<div class="inside">
    				<p>
                    	Select Categories You Want to be set as Featured:<br />
                        <?php
    					$cats = wp_dropdown_categories('name=blogsetings[featured_cats][]&class=catOptions&hierarchical=1&hide_empty=0&echo=0');
    					$cats = str_replace('<select ', '<select multiple="multiple" ', $cats);
    					$fcats = $theme_settings[featured_cats];
    					if (is_array ($fcats)):
    						foreach ($fcats as $cid):
    							$cats = str_replace('value="' . $cid . '"', 'value="' . $cid . '" selected="selected"', $cats);
    						endforeach;
    						echo $cats;
    					else:
    						echo $cats;
    					endif;
    					?>
                    </p>
                </div>
    		</div>
    
    		<p class="submit">
    		<input type="submit" name="action" class="button-primary" value="Save Settings" />
    		<input type="submit" name="action" class="button-highlighted" value="Reset Settings" />
    		</p>
    
    	</div>
    
    	<?php // end second column ?>
    
    	</form>
    
    </div>
    <?php }
    
    include ('blog-cms.php')
    
    ?>

    here is my functions.php..where should i insert it..i tried it insert after its last code but nothing worked..

    Go to wp-content/themes/twentyten/functions.php to see how’s this from there.

    This whould work anywhere, just make sure that you have <?php and ?> around it.

    function theme_settings_admin() { ?> after this is fine, since your functions.php looks bit weird.

Viewing 15 replies - 1 through 15 (of 28 total)
  • The topic ‘Iam working on Lyrics site..’ is closed to new replies.