Jump to content
Sign in to follow this  
marmaristasarim

How can I add a table to show up on posts only and not pages

Recommended Posts

marmaristasarim

Hello I would like to place a table to show up on posts linked to certain categories. I placed my table into the template.postloop.php file. It shows up great and the right place on the frontend in the posts. However it also shows up on all the pages and template pages as well, which I don't want it to do. Is there a way I can overcome this to have my table show up only on the posts linked to certain categories? Normally I would place it in the single.php file but it doesn't seem to work that way. I have used the plugin magic fields and created write panel with the fields that would be filled in when creating a new post. This works too. It shows up when I go to add a new post. I filled in the fields and that shows up on the frontend as well. Only one problem, this table shows up on the pages. :( Any suggestions is greatly appreciated. Thank you in advance for your help.

Share this post


Link to post
Share on other sites
marmaristasarim

Thank you for your reply Kate. Actually I marked as being resolved (this thread) but I am having a problem now with the table showing above the content and title. The code for the table is placed in this file: template.postloop.php , and its showing up on the posts on the front end, and not the pages, which is good! But the title and content of the page is underneath the table. Do you have any suggestions as to where I should place the table's code so that the title and content are above the title and content? I tried in different spots of the template.postloop.php file but then the table ends up showing on all the pages too - which is not what it should do. I need for it to show ONLY on posts. Thank you in advance! :)

Share this post


Link to post
Share on other sites
cmunns

Look for `the_title()` in the template.postloop file and put it above it...experiment a little with positioning.

Share this post


Link to post
Share on other sites
marmaristasarim

Thank you Adam. I placed this code

<?php
												pagelines_get_post_title();
												pagelines_get_post_metabar();
											?>

above the table and it worked. :) However I am now stuck with what code (body of post/content) to place in between this title code and the table code. As I am not familar with reading codes do you have any suggestions as to which code I should place in between? Thank you very much.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×