ekdor
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Image Caption Div adding 10pxThe site is still under development. The content is still just sample stuff that the intended owner is using to practice using the wordpress cms.
Forum: Themes and Templates
In reply to: Image Caption Div adding 10pxIt’s one I have built from scratch.
Forum: Themes and Templates
In reply to: Can't get a total count for posts in listed loop of categoryThe
<?php echo $wp_query->found_posts; ?>
worked a treat! ThanksForum: Fixing WordPress
In reply to: "Invalid argument supplied for foreach() in" "post.php on line 3588"removed
Forum: Themes and Templates
In reply to: Can't get a total count for posts in listed loop of category$term_id = $id = get_queried_object(); // ID of taxonomy term $taxonomy = 'category'; $term_obj = get_term( $term_id, $taxonomy ); echo '<p>There are ' . $term_obj->count . ' posts in the ' . $term_obj->name . ' category.</p>';
This seems to work better. Works for taxonomy also, I just had to put the slug for one of my taxonomies in place of
'category'
. Doesn’t seem to effect the results of my count; which is the only part of it that I wanted. My code as follows:<DIV CLASS="listHeading"> <H3>Showing <SPAN CLASS="entryNo"><?php $term_id = $id = get_queried_object(); $taxonomy = 'source'; $term_obj = get_term( $term_id, $taxonomy ); echo $term_obj->count; ?></SPAN> items for:</H3> <H2><?php single_cat_title() ?></H2> </DIV>
Still not working for the search results template… Tried using the values given in my search field tag.
Cheers,.
Forum: Themes and Templates
In reply to: Can't get a total count for posts in listed loop of categoryHowever I can’t get it to work on my Search and Taxonomy templates.
Forum: Themes and Templates
In reply to: Can't get a total count for posts in listed loop of categoryWooHoo. I got what I wanted. I found a bit of code that determine the catagory ID and placed it into the
$term_id
. It’s as follow:$term_id = $id = get_queried_object_id(); // ID of taxonomy term $taxonomy = 'category'; $term_obj = get_term( $term_id, $taxonomy ); echo '<p>There are ' . $term_obj->count . ' posts in the ' . $term_obj->name . ' category.</p>';
Cool…
Thanks for your help.
Forum: Themes and Templates
In reply to: Can't get a total count for posts in listed loop of categoryHmm I see. I replaced the
$term_id
with the appropriate number from one of my categories. This worked. However because this is entered in the category template it means all categories will show the number for that one category. I need it to acquire the$term_id
for the category/taxonomy that has been selected.Cheers,.
Forum: Themes and Templates
In reply to: Can't get a total count for posts in listed loop of categoryAlso, for the taxonomy. I use a single taxonomy template but have 7 separate taxonomies. 5 have menubar links but all are listable. How would I get it to distinguish the appropriate taxonomy filter being displayed?
Cheers,.
Forum: Themes and Templates
In reply to: Can't get a total count for posts in listed loop of categoryOk Thanks,
Well I got a result this time. But it returns the value zero for categories.
Cheers,.
Forum: Themes and Templates
In reply to: Theme Layout ToggleI see. I’ll follow the toggleClass lead. Thanks.
Forum: Themes and Templates
In reply to: Theme Layout ToggleWell There are many that will show a list of entries and you can toggle it between a grid and a list. https://www.tv.com/shows/game-of-thrones/episodes/ Not sure if this is the method I want but it’s the kind of behaviour.
Been thinking about it some more. I’m not advanced enough to figure this out myself. But I assume I could us an if statement in the loop that checks the state of the toggle and marks up using the corresponding set of php. This would contain the two states within the one php file.
Cheers,.
Forum: Themes and Templates
In reply to: Altering a JetPack module without modifying it?Hmm, I’ve read through https://codex.www.ads-software.com/Child_Themes and don’t see how I could do this. After-all Jet-Pack is a plug-in and not part of the theme package. Child themes only effect the Parent theme and not plug-ins as far as I can tell. Is there more to this, is there a way to create a child to a plug-in?
Cheers,.
Forum: Themes and Templates
In reply to: Altering a JetPack module without modifying it?Ok thanks, I’ll start reading up on the subject.
Forum: Reviews
In reply to: [Google Doc Embedder] horrible quality of pdfwould this be to do with google?