Forum Replies Created

Viewing 13 replies - 1 through 13 (of 13 total)
  • Thread Starter Connor Miles

    (@connor15)

    ok thanks is there like a place where this is first mentioned or like a function defining the text domain

    Thread Starter Connor Miles

    (@connor15)

    hi,

    thanks i know that was causing it but as you can see i have tried adding these <p><a><b><br /><input><form><img><textarea><li><ol><ul><table> as exceptions but its not working

    Thread Starter Connor Miles

    (@connor15)

    ” God Send ” You are the best on the forum by far

    Thread Starter Connor Miles

    (@connor15)

    please ignore my stupidness it wasnt wrapped in a loop hah sorry

    * CASE CLOSED

    Thread Starter Connor Miles

    (@connor15)

    heres a bit more info

    heres my php

    <section class="entry">
    
    	 <?php
         // CHECK IF THE POST HAS A THUMBNAIL ASSIGNED TO IT
    	 	if ( has_post_thumbnail() ) {
     		 the_post_thumbnail('thumb-800x700');} ?>
    
            <?php the_content(); ?>
    
        </section>

    and heres the output

    <section class="entry">
    <img width="800" height="500" src="http://localhost/wp-content/uploads/2012/12/ZA-wp1.jpg" class="attachment-thumb-800x700 wp-post-image" alt="African Elephant Walking on Savanna" />
    </section>

    Thread Starter Connor Miles

    (@connor15)

    also the_content(); isnt working i think theres something seriosly wrong here

    Thread Starter Connor Miles

    (@connor15)

    hi,

    im getting a syntax error on that and just to be clear im not ob about just the menus the actual menu link in the the dashboard is not showing up under the themes link so i cant manage the menus

    Thread Starter Connor Miles

    (@connor15)

    Also just thaught ide let you know that i have figured a way for it to say PUBLISHED instead of publish, its a bit of a bodge job but it works heres the php

    <td><?php echo '<div class="posts-status-' . get_post_status( get_the_ID() ) . '';?>"><?php echo get_post_status( get_the_ID() ) ?> <span>ed</span> </div></td>

    i added ED into a span at the end

    and the CSS (LESS CSS)

    .posts-status-pending {
    
    span{
    display:none;
    }
    
    background-color: #F00;
    text-align: center;
    width: 100px;
    margin:0 auto;
    .border-radius(3px);
    text-transform:uppercase;
    
    }
    Thread Starter Connor Miles

    (@connor15)

    ok, thanks for your help really appreciate it thanks i have started another post here http://wordpress.org/support/topic/add-posts-from-frontend?replies=1 maybe you coulde help here if you have nothing else to do.

    Thanks again

    Thread Starter Connor Miles

    (@connor15)

    Thanks alot i had to edit the code to make it this

    <td><?php echo '<div class="posts-status-' . get_post_status( get_the_ID() ) . '';?>"><?php echo get_post_status( get_the_ID() ) ?></div> </td>

    one more question when it outputs the post status as ones that are published do you have any idea of why it says publish instead of published, as this is not right as the post is published and not publish and fixes for this would be great,

    Thanks Again

    Thread Starter Connor Miles

    (@connor15)

    Thanks alchymyth i know i have to add html & CSS but i dont know where to put it and i need it to be dynamic so a different style for each different post status
    heres full code

    <?php
    /* Template Name: View Posts */
    if ( !current_user_can('publish_posts')) {
    	include('reject-view-posts.php');
    	exit(0);
    }
    ?>
    <?php get_header(); ?>
    
    <?php  
    
    $query = new WP_Query( array(
        'post_type' => 'post',
        'posts_per_page' => '-1',
        'post_status' => array(
            'publish',
            'pending',
            'draft',
            'private',
        )
    ) );
    ?>
    
    <div id="content">
    
    <div id="inner-content" class="wrap clearfix">
    <table id="view-posts-table">
        <tr id="view-posts-table-top">
            <th width="25%" >Post Title</th>
            <th width="35%">Post Excerpt</th>
            <th width="15%">Post Status</th>
            <th width="15%">Actions</th>
        </tr>
      		<?php if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>
    	<tr>
            <td class="insert-posts-title"><?php echo get_the_title(); ?></td>
            <td><?php echo substr(get_the_excerpt(), 0,170); ?></td>
            <td><?php echo '<div id="posts-status">' . get_post_status( get_the_ID() )?></td>
            <td><?php $edit_post = add_query_arg( 'post', get_the_ID(), get_permalink( 74 + $_POST['_wp_http_referer'] ) ); ?>
            <a href="<?php echo $edit_post; ?>">Edit</a> <?php if( !(get_post_status() == 'trash') ) : ?>
        <a class="confirm-dialog" href="<?php echo get_delete_post_link( get_the_ID() ); ?>">Delete</a>
    <?php endif; ?></td>
        </tr>
    <?php endwhile; endif; ?>
    </table>
    
    </div>
    </div>
    
    <?php get_footer(); ?>

    Thank you

    Hi smnsaysdesign,

    im sure there are many ways to do this, but here is my solution.

    create a new file in your theme folder called your-custom-post-type-archives.php

    add the following code in that file :

    <?php /* Template Name: Custom Post Type Archive */
    get_header(); ?>
    
    <?php
    global $query_string;
    query_posts($query_string . "post_type=YOUR-CUSTOM-POST-TYPE&post_status=publish&posts_per_page=10");
    if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    
    <h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
    <?php the_excerpt(); ?>
    
    <?php endwhile;
    endif; ?>
    <div class="navigation">
    	<div class="alignleft"><?php next_posts_link('Previous entries') ?></div>
    	<div class="alignright"><?php previous_posts_link('Next entries') ?></div>
    </div>
    <?php wp_reset_query(); ?>
    
    <?php get_sidebar(); ?>
    <?php get_footer();?>

    REMEMBER TO REPLACE YOUR-CUSTOM-POST-TYPE WITH THE NAME OF YOUR CUSTOM POST TYPE

    and then create a new page in wp dashboard and select Custom Post Type Archive as the page template.

    Then you should have what you want.

    Good luck

    Thread Starter Connor Miles

    (@connor15)

    Connor *

Viewing 13 replies - 1 through 13 (of 13 total)