• I Would like to use custom post types in my songs lyrics website created with hueman theme. I Would like to know the steps.

Viewing 15 replies - 1 through 15 (of 16 total)
  • Thread Starter vtlaxan

    (@vtlaxan)

    Actual problem is regarding the custom post type archive template.

    Hi vtlaxan. Welcome to the Hueman forum. I don’t do much with CPT but ask away and I’ll see if I can help.

    Thread Starter vtlaxan

    (@vtlaxan)

    Hi bd… First of all thanks for your reply. I have created a custom post type named “movies” using custom post type UI plugin and its working fine. i Would like to design a archive page template in a list view like the way this site using See the example site in this link

    I tried this using so many tutorials and im helpless. If you can, this will be a big help.

    Looking forward for your reply.

    Afraid I can’t be of much help here. That’s a WP site but hard to tell what they’re using because the code is minified on a CDN. The page is basically an unordered list of images and links in a single post. They could be using a plugin, or it could be a custom loop in a php template that gets data from the database. Here’s an article that describes how to create a custom page template:
    https://www.elegantthemes.com/blog/resources/an-introduction-to-wordpress-page-templates

    • This reply was modified 8 years, 2 months ago by bdbrown.
    Thread Starter vtlaxan

    (@vtlaxan)

    Dear bd,,,, We just skip my previous example….

    Can you please assist me to code a template like this for my movie custom post type in hueman theme?

    View the Link Here

    Thread Starter vtlaxan

    (@vtlaxan)

    Its a big burden for me,,,,

    Please try to help…

    The basic page layout on the site you linked can be achieved by using the Hueman standard post layout (posts in one column). If your site is already set with that option then your CPT should be displayed in the single-column format. If you don’t want your entire site in that format, you could create a post-type-specific page using archive.php as described here:
    https://www.wpbeginner.com/wp-tutorials/how-to-create-a-custom-post-types-archive-page-in-wordpress/

    Then you would change the post display section of your custom page template from this:

    <?php if ( hu_is_checked('blog-standard') ): ?>
    	<?php while ( have_posts() ): the_post(); ?>
    		<?php get_template_part('content-standard'); ?>
    	<?php endwhile; ?>
    <?php else: ?>
    <div class="post-list group">
    	<?php $i = 1; echo '<div class="post-row">'; while ( have_posts() ): the_post(); ?>
    		<?php get_template_part('content'); ?>
    	<?php if($i % 2 == 0) { echo '</div><div class="post-row">'; } $i++; endwhile; echo '</div>'; ?>
    </div><!--/.post-list-->
    <?php endif; ?>

    to this:

    <?php while ( have_posts() ): the_post(); ?>
        <?php get_template_part('content-standard'); ?>
    <?php endwhile; ?>

    In any case you might need some custom CSS to style it exactly how you want.

    Thread Starter vtlaxan

    (@vtlaxan)

    Thanks for this…. its working fine… but another one thing….
    When i add custom css in the style.css in the child theme, that is not working…. please help on this….

    Can you post a link to your site that includes the CSS that’s not working? Thanks.

    • This reply was modified 8 years, 2 months ago by bdbrown.
    Thread Starter vtlaxan

    (@vtlaxan)

    Hi BdBrown,,,

    I Would like to know that how can i place the custom post types in the hueman theme homepage… i was tried using the following code in the functions.php

    function my_get_posts( $query ) {

    if ( is_home() && $query->is_main_query() )
    $query->set( ‘post_type’, array( ‘post’, ‘page’, ‘album’, ‘movies’, ‘quote’ ) );

    return $query;
    }

    code is working fine and it is displaying the custom post type in the home page. But, custom post type thumbnails in the home page are way different and large from the normal post thumbnails in the home page. View the screenshot Here

    Please Help me with this. Im unable to post my site link since im using local host to configure the site,,,,

    waiting for your reply….

    I’m confused on where you are. First we discussed creating a custom post type archive page, and you said that was working fine. Then you asked about custom css but you didn’t specify what CSS you were using. Now you’re saying your custom function (is that assigned to a hook or action?) is working on the home page, but the custom post types are being displayed differently. What are you using to define your custom post types? Having an image that shows the problem is helpful, but there’s almost no way to troubleshoot that without seeing the source code and CSS that’s being applied. If you want to copy the code from your home page php file (whether that’s index.php or some other template you’re using) and the custom CSS you’re using to https://pastebin.com/, then post a link to that code here, I’ll take a look at it.

    Thread Starter vtlaxan

    (@vtlaxan)

    Here is the code for Index.php

    Here is the code for Custom CSS

    • This reply was modified 8 years, 2 months ago by vtlaxan.

    Based on the image you posted it doesn’t appear that your blog is set to use the Standard List layout; it’s showing two posts per row. Your CSS is using the “.post-standard” class which isn’t used in the default blog layout.

    • This reply was modified 8 years, 2 months ago by bdbrown.
    Thread Starter vtlaxan

    (@vtlaxan)

    can u please post the standard codes to display the homepage as i requested including custom post types?

    Thread Starter vtlaxan

    (@vtlaxan)

    i can send u all my child theme files.. can u please go-through them and amend the codes as i requested?

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Custom Post type with hueman theme.’ is closed to new replies.