• Resolved werkgroepinternet

    (@werkgroepinternet)


    Hello! I’m trying to create a custom template for the Pinnacle theme. The idea is that the author of the page is used to fetch the last blog-post and last portfolio-item created by this user. I’ve done this with Page Builder by SiteOrigin, but found it to be not so good looking.

    So, the idea is that both the post and portfolio would be displayed next to each other (same row) on the page. In the future I would like to display also the page-author biography and page-author occupation, but first things first: for now only the last blog-post next to last portfolio-item.

    I’ve already made a child-theme, template-folder and inside the template folder a file named template-commissie.php. Coded is now:

    <?php
    /*
    Template Name: Commissie
    */
    	get_header();
    		get_template_part('templates/page', 'header'); ?>
    		<div wrap>
    		    <div id="content" class="container">
       			    <div class="row">
       		            <div class="main <?php echo esc_attr( pinnacle_main_class() );?>" role="main">
    	      		        <div class="entry-content" itemprop="mainContentOfPage">
    	      		            <?php get_template_part('templates/content', 'page'); ?>
          		            </div><!-- /.entry-content-->
    	      		    </div><!-- /.main-->
    					<?php get_sidebar(); ?>
        			</div><!-- /.row-->
        		</div><!-- /.content -->
      		</div><!-- /.wrap -->
      	<?php get_footer(); ?>

    An example of one of the pages which will be using this template, is test.mebiose.nl/vereniging/commissies/galacommissie.

    Which template parts do I need to get?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Theme Author Ben Ritner – Kadence WP

    (@britner)

    Hey so actually this shouldn’t be in the templates folder. You would just add this to the child theme folder.

    Then remove<?php get_template_part('templates/content', 'page'); ?>and there place the code you want to pull in posts.

    Kadence Themes

    Thread Starter werkgroepinternet

    (@werkgroepinternet)

    Yeah, I already figured that out, but I’m not yet advanced enough in coding, to write the entire loop for this action.

    I moved my template for multiple pages out of the pinnacle-child/templates into pinnacle-child.

    However, I’m curious whether I can use the get_template_part of the templates of the Pinnacle theme, to get what I want: blog & portfolio on the same page.

    Something like

    <?php
    get_template_part('templates/content-fullpost', 'page');
    get_template_part('templates/content-singleportfolio', 'page'); ?>

    isn’t working. Is something like this even possible with get_template_part?

    Theme Author Ben Ritner – Kadence WP

    (@britner)

    ok, so

    content-fullpost', 'page' isn’t a file… get_template_part calls a template. but there is not content-fullpost-page.php file

    There isn’t anything in this theme that would mix blog post and portfolio. I’m also not sure at all what your wanting in the end or what your asking from me? Your talking about a big coding change if your trying to make two post types loop together on a page. This isn’t really something theme support can write for you.

    Kadence Themes

    Thread Starter werkgroepinternet

    (@werkgroepinternet)

    I’m sorry! I now see I have to call these files like get_template_part('templates/content', 'fullpost');
    or
    get_template_part('templates/content', 'singleportfolio');
    I’m a real noob, as you probably could tell already.

    I’m not trying to mix those posts btw, I’m trying to create a template which loops the latest blog post of a (to be set in page-settings) category in a column, and in the next column the latest portfolio post of a (to be set in page-settings) category. Something like

    Latest Blog post title | Latest Portfolio title
    Author date etc here | Example photo of last portfolio
    Text of last post here |

    Theme Author Ben Ritner – Kadence WP

    (@britner)

    Here is about the best suggestion I can give without telling you that you need to hire a developer.

    Use this plugin: https://wordpress.org/plugins/siteorigin-panels/

    Then use the “post loop” widget to add the items you want.

    Kadence Themes

    Thread Starter werkgroepinternet

    (@werkgroepinternet)

    Haha, thanks. As stated before

    I’ve done this with Page Builder by SiteOrigin, but found it to be not so good looking.

    , but I’ll try to make this work then.

    Thanks for your effort!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Custom Template with Blog & Portfolio on same page’ is closed to new replies.