CrispySinger
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Accurate Page Views PluginHey, thanks for the replies.
I was just wanting to display the views on each article and review. Just didn’t want to have to start the count again after the previous articles had already been published for a while. May just use that method for future articles I guess.
Cheers.
Forum: Themes and Templates
In reply to: Giving php generated divs different classesSorry for the late reply. I got it working in the end by using a CSS “first-of-type” & “last-of-type” to get the five Divs to fit within the container properly.
The issue was that the boxes wouldn’t align with content above it and due to a client wanting the boxes to be spot on with that content I was required to edit it a bit. So I had to have the first and last divs flush with the side of the container and the rest aligned to suit. I’m using Roots to so that’s why I needed to tweak it a bit to override some of the styles for generated column classes. Normally wouldn’t be a problem but because I was using a for each loop to display the divs I was unsure as to how to style each div the way I wanted.
Probably not the best fix but its working for now.
Cheers for the help!
Forum: Plugins
In reply to: [Pods - Custom Content Types and Fields] Pods – A unique page for each Pod.Sorry for the very late reply, been busy with work.
Got it working in the end, turns out it was a case of adding “-podname” after the “single.php” file for each Pod I wanted to display. I.e. “single-clients.php”
I tried doing that at the start but due to editing the wrong file I assumed it wasn’t working. After I realised how the files were pulled together it all made sense.
Thanks for the assistance!
Forum: Plugins
In reply to: [Pods - Custom Content Types and Fields] Pods – A unique page for each Pod.Analysing it a bit more, I think I understand it now. Will test something and see if it works.
Forum: Plugins
In reply to: [Pods - Custom Content Types and Fields] Pods – A unique page for each Pod.Yeah, it’s basically what every Post uses as a template. At the moment the page is set up so that it will grab the content for the desired pod based on the URL which was clicked on.
<?php //get the current slug $slug = pods_v( 'last', 'url' ); //get pods object $mypod = pods( 'case_study', $slug ); // set our variables $name= $mypod->field('title'); $location= $mypod->field('location'); $cont= $mypod->field('content'); $gallery= do_shortcode( $mypod->display('gallery') ); $image= $mypod->display('image'); $quote= $mypod->field('quote'); $subtext= $mypod->field('sub_text'); $permalink= $mypod->field('permalink'); ?>
This works for any Pod dependant pages but obviously when loading a post or the likes the post content shows but the layout for the Pod content still shows, just with no content there.
I tried adding the code from the example to that page and when done it grabs the content through for a Post that has been clicked on, by this part I assume
get_template_part( 'content', $part );
.Does that code need to go on the/each custom post template file, or would I need to add it elsewhere?
P.S. Using Roots and building my own theme, if that helps about the structure of default files etc.
Cheers.