WordPress.org

Ready to get started?Download WordPress

Forums

Title of blog post missing on "Blog" page (9 posts)

  1. janicereinold
    Member
    Posted 4 months ago #

    HELP!

    I can't seem to get the title of each blog post to appear on our organization website: http://pplac.org/blog/

    I'm using the theme Modernize, with Woo Commerce capability.

    Can anyone help me fix this? I know very basic coding...

    Thank You!!

  2. Evan Herman
    Member
    Posted 4 months ago #

    You'll probably need to open up single.php (if that's what your theme has it named) and then you'll need to add the correct WordPress function to grab the post name and display it.

    The correct function inside the loop would be:

    <?php echo the_title(); ?>

    which would print the current page title in that location.

  3. janicereinold
    Member
    Posted 4 months ago #

    Thank you Evan, Where in single.php would I need to post the function?

  4. Evan Herman
    Member
    Posted 4 months ago #

    At the top, or wherever you would like the title to appear.

    I would say right above where the Author information prints out. You should be able to find it by searching for "Written by"

  5. Evan Herman
    Member
    Posted 4 months ago #

    I didn't realize that that page you posted a link to was an entire page in itself. Single.php would be the single blog posting, so if you clicked into a post to read more you would then be served single.php.

    I'm not sure how your displaying blog posts on that page template, but you'll need to find the .php file that is associate to the blog roll.

    You can probably do so by going to 'Pages' and then clicking the page that holds all your blog posts, and checking the current page template on the right hand side. You'll then need to go searching through the .php files for that template tag at the top of the file.

    That would be the file you need to edit.

  6. janicereinold
    Member
    Posted 4 months ago #

    The blog posts are displayed under my "blog" page, but I don't see the blog roll or any coding in it when I click on the "text" tab. I can't seem to figure out how the blog posts are appearing on my "blog" page.

    I'm looking at the various php files, and I'm seeing a page.php - not sure if this is where I need to put in some extra lines to make the title appear? At one point, I see this:

    // Page title and content
    				$gdl_show_title = get_post_meta($post->ID, 'page-option-show-title', true);
    				$gdl_show_content = get_post_meta($post->ID, 'page-option-show-content', true);
    				if ( $gdl_show_title != "No" ){
    					while (have_posts()){ the_post();
    						echo '<div class="sixteen columns mt30">';
    						echo '<h1 class="gdl-page-title gdl-divider gdl-title title-color">';
    						the_title();
    						echo '</h1>';
    						$content = get_the_content();
    						$content = apply_filters('the_content', $content);
    						if( $gdl_show_content != 'No' && !empty( $content ) ){
    							echo '<div class="gdl-page-content">';
    							echo $content;
    							wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'gdl_front_end' ) . '</span>', 'after' => '</div>' ) );
    							echo '</div>';
    						}

    Does this help in any way/

  7. Evan Herman
    Member
    Posted 4 months ago #

    That looks like the individual page file. As you can see in the the_title() is printing out the title.

    an example of page.php being used is on a page like this:
    http://pplac.org/2014/03/25/display-your-images-at-the-ppc-pro-photo-expo-conference/

    There is either a page called blog.php, page-blog.php, or some other custom php file that's displaying the blog.

  8. janicereinold
    Member
    Posted 4 months ago #

    Below are all the php I see in my editor. Would you know which I'd need to edit?

    404.php
    archive.php
    comments.php
    footer.php
    functions.php
    header.php
    function-regist.php
    gallery-option.php
    goodlayers-option.php
    include-script.php
    meta-template.php
    page-option.php
    personnel-option.php
    portfolio-option.php
    post-option.php
    price-table-option.php
    style-custom.php
    testimonial-option.php
    index.php
    cufon-replace.php
    Site Map Page Template
    (page-sitemap.php)
    page.php
    search.php
    searchform.php
    sidebar-left.php
    sidebar-right.php
    sidebar.php
    single-portfolio.php
    single.php
    ie-style.php
    woocommerce.php

  9. Evan Herman
    Member
    Posted 4 months ago #

    I don't just by looking at the file names. From looking I'd assume there is some conditional check within one of the files, checking if its the blog page and then running the loop.

    Look for the loop within one of the files, that should help locate the correct template:

    https://codex.wordpress.org/The_Loop

    You'll probably see something like

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

Reply

You must log in to post.

About this Topic