• hi i need how to add read TITLE of post, i tried <!–more–> tag in the title and not working, i really cant find any solution for this.

    Example : MP3Goo.com , the home page shows ‘Taylor Swift’ , but when you click it shows ‘Taylor Swift MP3 DOWNLOAD’ HOW HE DO THAT?

    sry bad english

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • You simply have to add whatever you want before the title in the loop. This means that you have to edit your themes files but there’s nothing tricky to it. For example inside a loop it would be something like:

    
    <?php 
    if ( have_posts() ) {
    	while ( have_posts() ) {
    		the_post(); 
    ?>
    <h1 class="post-title"><a href="<?php the_permalink(); ?>">Read: <?php the_title(); ?></a></h1>
    <?php		
    	} // end while
    } // end if
    ?>
    
    Thread Starter skadiog

    (@skadiog)

    thanks for reply, i look up the ‘Loop’ Here https://developer.www.ads-software.com/themes/basics/the-loop/
    and after i put in the loop codes my website crash ‘website programing error or under constructions’,but i have backup the theme.
    i just want to make ‘How To’ Text appear in post and not appear in other pages. can somebody see how i can do it? Thanks!!!

    
    <?php $mts_options = get_option(MTS_THEME_NAME);
    get_header();
    if ( !is_paged() && $mts_options['mts_featured_slider'] == '1' ) { ?>
        <div class="featuredBox">
            <?php $i = 1;
            // prevent implode error
            if ( empty( $mts_options['mts_featured_slider_cat'] ) || !is_array( $mts_options['mts_featured_slider_cat'] ) ) {
                $mts_options['mts_featured_slider_cat'] = array('0');
            }
            $slider_cat = implode( ",", $mts_options['mts_featured_slider_cat'] );
            $slider_query = new WP_Query('cat='.$slider_cat.'&posts_per_page=4&ignore_sticky_posts=1'); 
            while ($slider_query->have_posts()) : $slider_query->the_post();
                if($i == 1){ ?> 
                    <div class="firstpost excerpt">
                        <a href="<?php echo esc_url( get_the_permalink() ); ?>" title="<?php echo esc_attr( get_the_title() ); ?>" id="first-thumbnail">
                            <?php echo '<div class="featured-thumbnail">'; the_post_thumbnail('pointpro-bigthumb',array('title' => '')); echo '</div>'; ?>
                            <p class="featured-excerpt">
                                <span class="featured-title"><?php the_title(); ?></span>
                                <span class="f-excerpt"><?php echo mts_excerpt(8);?></span>
                            </p>
                        </a>
                    </div><!--.post excerpt-->
                <?php } elseif($i == 2) { ?>
                    <div class="secondpost excerpt">
                        <a href="<?php echo esc_url( get_the_permalink() ); ?>" title="<?php echo esc_attr( get_the_title() ); ?>" id="second-thumbnail">
                            <?php echo '<div class="featured-thumbnail">'; the_post_thumbnail('pointpro-mediumthumb',array('title' => '')); echo '</div>'; ?>
                            <p class="featured-excerpt">
                                <span class="featured-title"><?php the_title(); ?></span>
                            </p>
                        </a>
                    </div><!--.post excerpt-->
                <?php } elseif($i == 3 || $i == 4) { ?>
                    <div class="thirdpost excerpt">
                        <a href="<?php echo esc_url( get_the_permalink() ); ?>" title="<?php echo esc_attr( get_the_title() ); ?>" id="third-thumbnail">
                            <?php echo '<div class="featured-thumbnail">'; the_post_thumbnail('pointpro-smallthumb',array('title' => '')); echo '</div>'; ?>
                            <p class="featured-excerpt">
                                <span class="featured-title"><?php the_title(); ?></span>
                            </p>
                        </a>
                    </div><!--.post excerpt-->
                <?php }
            $i++; endwhile; wp_reset_query(); ?> 
        </div>
    <?php } ?>
    <div id="page">
        <div class="article <?php echo ($mts_options['mts_full_posts'] == '1') ? 'index-2' : ''; ?>">
            <div id="content_box">
                <?php if ( !is_paged() ) {
                    $featured_categories = array();
                    if ( !empty( $mts_options['mts_featured_categories'] ) ) {
                        foreach ( $mts_options['mts_featured_categories'] as $section ) {
                            $category_id = $section['mts_featured_category'];
                            $featured_categories[] = $category_id;
                            $posts_num = $section['mts_featured_category_postsnum'];
                            if ( 'latest' == $category_id ) { ?>
                                <h3 class="featured-category-title"><?php _e('Latest', 'pointpro' ); ?></h3>
                                <?php $j = 0; if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
                                    <article class="latestPost excerpt <?php echo (++$j % 3 == 0) ? 'last' : ''; ?> <?php echo (++$j % 3 == 0) ? 'full-post' : ''; ?>">
                                        <?php mts_archive_post(); ?>
                                    </article>
                                <?php endwhile; endif; ?>
                                
                                <?php if ( $j !== 0 ) { // No pagination if there is no posts
                                    mts_pagination();
                                } ?>
                                
                            <?php } else { // if $category_id != 'latest': ?>
                                <h3 class="featured-category-title"><a href="<?php echo esc_url( get_category_link( $category_id ) ); ?>" title="<?php echo esc_attr( get_cat_name( $category_id ) ); ?>"><?php echo esc_html( get_cat_name( $category_id ) ); ?></a></h3>
                                <?php
                                $j = 0;
                                $cat_query = new WP_Query('cat='.$category_id.'&posts_per_page='.$posts_num);
                                if ( $cat_query->have_posts() ) : while ( $cat_query->have_posts() ) : $cat_query->the_post(); ?>
                                    <article class="latestPost excerpt <?php echo (++$j % 3 == 0) ? 'last' : ''; ?>">
                                        <?php mts_archive_post(); ?>
                                    </article>
                                <?php endwhile; endif; wp_reset_postdata();
                            }
                        }
                    }
                } else { //Paged
                    $j = 0; if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
                    <article class="latestPost excerpt <?php echo (++$j % 3 == 0) ? 'last' : ''; ?>">
                        <?php mts_archive_post(); ?>
                    </article>
                    <?php endwhile; endif; ?>
    
                    <?php if ( $j !== 0 ) { // No pagination if there is no posts
                        mts_pagination();
                    }
                } ?>
            </div>
        </div>
        <?php get_sidebar(); ?>
    </div>
    <?php get_footer(); ?>;
    • This reply was modified 7 years, 5 months ago by skadiog.
    • This reply was modified 7 years, 5 months ago by skadiog.
    • This reply was modified 7 years, 5 months ago by skadiog.
    Thread Starter skadiog

    (@skadiog)

    can someone suggest me a link for loop Easy toturial.

    Hello again,

    The code you provided is probably from the wrong file. I don’t know your theme though so it’s a little hard to tell you exactly where to put it but usually there will be a single.php that handles the post’s page so probably we’ll have to make the edits there.

    If your theme is free and open sourced you can give me a link to check it and tell you what you need to change. If it’s not free then you can contact the Author of the theme as you paid for it he should be more than willing to help you as well.

    As for the loop that you asked here’s a reference page: https://developer.www.ads-software.com/themes/basics/the-loop/

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to tag to TITLE only?’ is closed to new replies.