So, I am using Html5blank to recreate an html template in wordpress. I had no problems with the header and footer, they are both perfect. The problem I am running into is getting my page.php to show the changes I have made to it and it weirdly does not seem to be conforming to my css styles, either. Any help at all would be greatly appreciated. Thanks!
ETA: I researched this site for quite a while and though there were a couple of questions that were somewhat similar, I didn't find anything that was my exact problem. I'm not sure why I got voted down but I suppose I should have mentioned that I did look around for this answer. Nobody seems to have this exact problem and if they have a similar one, their resolution didn't help me at all.
Here is the code for my page.php
<?php get_header(); ?>
<!-- MAIN CONTENT -->
<div id="outermain">
<div class="container">
<div class="row">
<section id="maincontent" class="twelve columns">
<div class="main">
<section class="content">
<article class="post">
<div class="postimg">
<div align="center">
</div>
</div>
<div class="entry-date">
<div class="postdate">02</div>
<div class="posttime">September</div>
</div>
<div class="entry-text">
<h2 class="posttitle">
Phasellus tempus mauris quis dui lobortis.</h2>
<?php if (have_posts()): while (have_posts()) : the_post(); ?>
<div class="entry-content">
<?php article id="post-<?php the_ID(); ?>"
<?php post_class(); ?>>
<?php the_content(); ?>
</div>
</div>
<div class="clear"></div>
<?php edit_post_link(); ?>
</article>
<?php endif; ?>
</section>
</div>
</section>
</div>
</div>
</div>
<!-- END MAIN CONTENT -->
<div id="shadowbottom"></div>
<?php get_footer(); ?>
I think you need to close your WP Loop with:
<?php endwhile; else: ?>
<p>Roops, no content here.</p>
<?php endif; ?>
Reference: http://codex.wordpress.org/The_Loop
Related
Here is LINK I am working on it. The About Us section is not displaying full contents and showing more button to go to next page whereas I want to show full contents of About Us page instead of short summary.
I checked a lot but not found any option in the theme to fix it
UPDATE:
I found this in (page-template/custom-home-page.php)
<?php while ( $query->have_posts() ) : $query->the_post(); ?>
<div class="row">
<div class="col-lg-8 col-md-7">
<h3><?php the_title(); ?></h3>
<hr>
<p><?php the_excerpt(); ?></p>
<div class="more-btn">
<?php esc_html_e('MORE','vw-one-page'); ?>
</div>
</div>
<div class="col-lg-4 col-md-5">
<img src="<?php the_post_thumbnail_url('full'); ?>"/>
</div>
</div>
<?php $i++; endwhile;
wp_reset_postdata();?>
<?php else : ?>
<div class="no-postfound"></div>
<?php endif;
endif;?>
</div>
</section>
Best regards
That code inside your theme with high probability.
Try to search inside theme files "/wp-content/themes/your_theme_name", something like that:
<div class="col-lg-8 col-md-7">
<h3>About Us</h3> <!-- Or <?php the_title(); ?> -->
<hr>
<?php the_exerpt(); ?>
<div class="more-btn">
MORE <!-- Or something like <?php the_permalink( ... ) ?> -->
</div>
</div>
This is an example. After all, I can't know how it is done in your theme.
Then <?php the_exerpt(); ?> change to <?php the_content(); ?>. and remove or hide:
<div class="more-btn">
...
</div>
But if this is not your personal WordPress theme, then it is better to do through Child Theme
I am currently learning how to convert a html page to wordpress and trying to do a single.php page. The problem tho is that the page only displays the_content(); When I have a lot of other html and other wordpress functions, why is it that only the get_content(); is the ONLY one showing up on the page? :
<?php get_header(); ?>
<!-- Page Header -->
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<header class="masthead" style="background-image: url('<?php echo get_template_directory_uri(); ?>/img/post-bg.jpg')">
<div class="overlay"></div>
<div class="container">
<div class="row">
<div class="col-lg-8 col-md-10 mx-auto">
<div class="post-heading">
<h1><?php the_title(); ?></h1>
<h2 class="subheading">Problems look mighty small from 150 miles up</h2>
<span class="meta">Posted by <?php the_author_posts_link(); ?> on <?php the_time('F j, Y g:i a'); ?></span>
</div>
</div>
</div>
</div>
</header>
<!-- Post Content -->
<article>
<div class="container">
<div class="row">
<div class="col-lg-8 col-md-10 mx-auto">
<?php echo "Test echo to see if I get that on the output" ?>
<?php the_content(); ?>
</div>
</div>
</div>
</article>
<?php endwhile; endif; ?>
<?php get_footer(); ?>
And The output that I am getting is:
<!-- Nav end -->
</nav>
<!-- single.php content -->
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor.</p>
<hr>
<!-- Footer -->
<footer>
<!-- Footer --> displays where the footer.php starts and <!-- Nav end --> is where the header.php ends
Thanks in advance
Remove header HTML header code you should be add in header.php file
And add following code in single.php
<?php get_header(); ?>
<!-- Page Header -->
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<!-- Post Content -->
<article>
<div class="container">
<div class="row">
<div class="col-lg-8 col-md-10 mx-auto">
<?php echo "Test echo to see if I get that on the output" ?>
<?php the_content(); ?>
</div>
</div>
</div>
</article>
<?php endwhile; endif; ?>
<?php get_footer(); ?>
I have been working on a custom archive page but I have run into some trouble. The pagination is shifting down into the footer area.
I have gone through my code several times and I cannot work out why this is happening. If I remove the loop, the template works correctly.
With the loop in place, the pagination shifts down to the footer and takes any coding below it (in the archive page) with it.
The archive page coding is:
<?php get_header(); ?>
<main role="main">
<section class="commissions">
<div class="commissions-section-one">
<h1>Commissions</h1>
<?php if(!function_exists('dynamic_sidebar') || !dynamic_sidebar('commissions-intro')) ?>
</div>
<?php get_template_part('single-commissions'); ?>
<?php get_template_part('pagination'); ?>
</section><!-- /section -->
</main><!--/ Main -->
<?php get_footer(); ?>
The custom loop code is:
<?php if (have_posts()): while (have_posts()) : the_post(); ?>
<div class="commission-wrapper">
<div class="commission-inner cf">
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="commission-content-wrapper">
<div class="commission-content-inner">
<img src="<?php the_field('commissions-company-logo'); ?>" />
<h2 class="company-author"><?php the_title(); ?></h2>
<p class="company-location"><?php the_field('commissions-company-location'); ?></p>
<p class="company-description"><?php the_field('commissions-company-description'); ?></p>
<p class="company-date"><?php the_field('commissions-company-date'); ?></p>
<?php echo do_shortcode("[indeed-social-media sm_list='fb,tw,goo,li' sm_template='ism_template_10' sm_list_align='horizontal' sm_display_counts='false' sm_display_full_name='false ]");?>
</div><!--/ Commission Content Inner -->
</div><!--/ Commission Content Wrapper -->
</article><!--/ Article -->
<div class="commission-images">
<div class="row first cf">
<div class="left-column" style="background-image:url(<?php the_field('commissions-image-one'); ?>);"></div>
<div class="right-column" style="background-image:url(<?php the_field('commissions-image-two'); ?>);"></div>
</div><!--/ Row -->
<div class="row cf">
<div class="left-column" style="background-image:url(<?php the_field('commissions-image-three'); ?>);"></div>
<div class="right-column" style="background-image:url(<?php the_field('commissions-image-four'); ?>);"></div>
</div><!--/ Row -->
</div><!--/ Commission Images -->
</div><!--/ Commission Inner -->
</div><!--/ Commission Wrapper -->
<?php endwhile; ?>
<?php else: ?>
<!-- article -->
<article>
<h1><?php _e( 'Sorry, nothing to display.', 'html5blank' ); ?></h1>
</article>
<!-- /article -->
<?php endif; ?>
<?php get_footer(); ?>
I am using the HTML 5 blank theme and haven't added anything additional in regards to pagination.
I'm not sure what you're doing with this line...
<?php if(!function_exists('dynamic_sidebar') || !dynamic_sidebar('commissions-intro')) ?>
...since you're not outputting anything. I'd either get rid of it, or fix it so that it's a valid conditional (with an endif;).
It also looks like you're calling get_footer() twice...
on my new theme in wordpress a <em> Tag is outputed, but i don't know why...
I dont use any <em> Tags anywhere in my theme, so i can't understand why this is outputed and destroys my design.
Here the Content of my index.php
<?php get_header(); ?>
<div class="row">
<div class="col-sm-12 blog-content">
<div class="container">
<div class="col-sm-8 blog-main">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="col-sm-12 blog-post">
<div class="date">
<div class="corner"></div>
<?php the_date('d M Y'); ?>
</div>
<h2><?php the_title(); ?></h2>
<div class="meta">
<i class="icon-user"></i>
<span><?php the_author(); ?></span>
<i class="icon-bookmark"></i>
<span><?php the_category(', '); ?></span>
<i class="icon-bubble"></i>
<?php comments_number('0 Kommentare', '1 Kommentare', '(% Kommentare)' );?>
</div>
<div class="entry">
<?php echo apply_filters('the_content', substr(get_the_content(), 0, 400) ); ?>
</div>
<div class="row">
<div class="col-sm-offset-8 col-sm-4 col-md-offset-9 col-md-3 col-lg-offset-9 col-lg-3 more">
<div class="btn">
Mehr lesen
</div>
</div>
</div>
</div>
<?php endwhile; endif; ?>
</div>
<div class="col-sm-3 col-sm-offset-1 blog-sidebar">
<?php get_sidebar(); ?>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>
Here you can watch my problem live. thorstenreichelt.de
Thanks for Help ;)
There is a em tag in your content (not in your theme). As you truncate it for the preview, in the first 400 characters you have the opening em tag but not the closing one, so the final HTML and your design are "broken".
Have a look at strip_tags() PHP function, or any equivalent used in Wordpress theming functions.
Try add this:
remove_filter ('the_content', 'wpautop');
remove_filter ('comment_text', 'wpautop');
at the final of the functions.php file from your theme.
Could it be that you're pasting in some content to that post from somewhere, and its some formatting thats coming across with it.
Have you gone into edit that post and click "text" in the top right corner of the main editing area, next to where it says visual. Is there a stray tag there?
I started to use Wordpress for a project, and using the following plugin Download Monitor
My page listings based on taxonomies all work fine, but im struggling with the search results
My form
<form role="search" method="get" class="right" id="download-form" action="<?php echo home_url( '/' ); ?>">
<div>
<input type="text" value="" name="dlm_download" id="dlm_download" placeholder="Search" />
</div>
</form>
So when i search and get the results mywebsite.com/?dlm_download=querythe home page gets show.
Than i created after research search-dlm_download.php, still get redirected to home.
Than i found this thread How to create a custom search for custom post type on wordpress exchange that does not work either.
So i am a bit stuck, could someone please point out what i am doing wrong?
EDIT:
search-dlm_download.php
<?php get_header(); ?>
<?php if (have_posts()) : ?>
<div id="page" class="border-top clearfix">
<div id="subtitle">
<h1><?php _e("Search Results for '$s'", 'framework') ?></h1>
<div id="breadcrumb"><?php the_breadcrumb(); ?></div>
<div class="hr4"><span class="seperator"></span><span class="lightborder"></span></div>
</div>
<div id="content-part">
<?php while (have_posts()) : the_post(); ?>
<div class="search-entry post-entry">
<h2><?php the_title(); ?></h2>
<div class="meta">
<?php _e('Posted on', 'framework'); ?> <strong><?php the_time('d.m.Y'); ?></strong> ยท <?php _e('Posted in', 'framework'); ?> <?php the_category(', ') ?>
</div>
<div class="entry">
<?php wpe_excerpt('wpe_excerptlength_blog', 'wpe_excerptmore'); ?>
</div>
<div class="entry-footer"></div>
</div>
<?php endwhile; ?>
<?php include (TEMPLATEPATH . '/framework/functions/nav.php' ); ?>
</div>
<div id="sidebar" class="sidebar-right">
<?php get_sidebar(); ?>
</div>
</div>
<?php else : ?>
<div id="page" class="border-top clearfix">
<div id="subtitle">
<h1><?php _e('No Results Found', 'framework') ?></h1>
<div id="breadcrumb"><?php the_breadcrumb(); ?></div>
<div class="hr4"><span class="seperator"></span><span class="lightborder"></span></div>
</div>
<div class="wrap clearfix">
<div id="content-part">
<div class="no-search-result">
<p><?php _e("Sorry, no results found. Try different words to describe what you are looking for.", 'framework') ?></p>
</div>
</div>
<div id="sidebar" class="sidebar-right">
<?php get_sidebar(); ?>
</div>
</div>
</div>
<?php endif; ?>
<?php get_footer(); ?>
Okay, found a solution by breaking the default search to 2 parts
If anybody needs it in the future you can find it here Create multiple search templates for custom post types