dunkkan
Forum Replies Created
-
Forum: Plugins
In reply to: Add a Menu in the DashboardI found a Theme called Magazeen which has a special template for it.
Forum: Plugins
In reply to: retrieve first image’s caption … in excerptI got it working, except that only for the title (not the caption), and from those images uploaded (not just linked) :
Inside the Loop :
<?php $args = array( 'post_type' => 'attachment', 'post_mime_type' => 'image', 'numberposts' => 1, 'post_parent' => $post->ID ); $attachments = get_children($args); if ($attachments) { foreach ($attachments as $attachment) { echo apply_filters('the_title', $attachment->post_title); } } ?>Taken from the Codex.
I hope someone can add/substract a bit more of code there π
Forum: Plugins
In reply to: retrieve first image’s caption … in excerptHere’s some code I’m working with :
function retrievecaption() { $files = get_children('post_parent='.get_the_ID().'&post_type=attachment&post_mime_type=image'); if($files) : //I'm lost here }I’m lost there.
Forum: Fixing WordPress
In reply to: Image Caption QuestionHi, here’s a way to do it with CSS :
http://tenthblog.com/wordpress/how-to-get-wp-caption-working-in-wordpress-26/
Forum: Fixing WordPress
In reply to: wp_list_pages and htmlI did it with JQuery, as I use it for everything.
I’m sure there are better ways, but, by now :
- Download JQuery (a minified version is ok)
- Place it in your theme’s folder, for instance in a folder called “js”
- Call it in your
<head>: just like<script type="text/javascript" src="http://mywebsite/blog/theme/js/jquery.js"></script> - The new WP tag :
<ul><?php wp_list_pages('link_after=<span class="clearstick"> | </span>'); ?></ul>Keep an eye to the
spanwith theclasswe are adding there. JQuery will target them to apply the changes we want.Finally in the footer, before the
</body>closing tag …<script> $(document).ready(function(){ $("ul li a:last .clearstick").text(""); }); </script>Those are the instruction JQuery needed. In english would be : find me an unordered list which have a last item with the
class.clearstick, then replace whatever it was inside with an empty space.Forum: Plugins
In reply to: if custom excerpt echo, else nullWow Michael that’s pure goodness. Thanks very much.
Forum: Themes and Templates
In reply to: Listing Subcategories with posts in category pageI’m in the same situation, please.
Forum: Plugins
In reply to: category page : list posts by subcategoriesI’ll do it with a custom page and
get_postsForum: Plugins
In reply to: Heart Icon to record hitsFound a possible solution here : http://planetozh.com/blog/2004/09/click-counter-plugin-for-wordpress/
and here : http://blog.ericlamb.net/projects/wp-click-track/
The first one needs to arrange some extra columns in the database, and the second one looks great but doesn’t seems to output the hits, because is intended to be statistical (admin-side).
I’ll get a look, hope that helps.
Forum: Plugins
In reply to: Heart Icon to record hitsHi guys,
I’ve been searching around, and I found quite of PHP scripts out there. I’m still searching the finest one to my purpouse though.
The following script will count page views, and output the results in the template, as seen here (not tested).
<?php /** * Create an empty text file called counterlog.txt and * upload to the same directory as the page you want to * count hits for. [Note: in my current theme's folder?] * * Add this line of code on your page: [Note: anywhere in a template?] * <?php include "text_file_hit_counter.php"; ?> */ // Open the file for reading $fp = fopen("counterlog.txt", "r"); // Get the existing count $count = fread($fp, 1024); // Close the file fclose($fp); // Add 1 to the existing count $count = $count + 1; // Display the number of hits // If you don't want to display it, comment out this line echo "Page views:" . $count . " "; // Reopen the file and erase the contents $fp = fopen("counterlog.txt", "w"); // Write the new count to the file fwrite($fp, $count); // Close the file fclose($fp); ?>Thanks if someone have some extra idea about that (unique hits in a link ?).
Forum: Fixing WordPress
In reply to: Uploading zip file for the users to downloadWow got it, through the image uploader.
Sorry, it’s 2 AM here in Europe and I’m beer-blogging tonight.
Thanks anyway !
Forum: Plugins
In reply to: Visitor > Data > Stats … and me.Hi Uncle Ash, you must have a look at Google Analytics : there’s a complete geolocalitzation screen.
A bit complicated to get it up and running, but still one of the bests.
Forum: Plugins
In reply to: audio files in sidebarWops, sorry again, yes it works.
I was just idioticly forgetting to put a title to my audio attachements. Anyway, you must specify what kind of stuff you’ll be retrieving, in that case
audio/mpeg, which I forgot to mention earlier.Sorry again
Forum: Plugins
In reply to: audio files in sidebarSorry for the delay if someone tried that with no succes, there are obviously several issues.
First you must specify the
post_mime_type. For example, toaudio/mpegorvideo.But when I do it, nothing is shown.
If I leave the space blank, the title of the eventual images of that post come together with the special attachements. How to avoid it ?
If I clear the image’s title in the Media Manager, then WordPress takes the file name and it gets printed anyway.
Thanks to anyone who can provide some light over this
Forum: Fixing WordPress
In reply to: Display most recent posts on static homepage – how?uops sorry, for further consultations, avobe, it must be
&category_nameand not &categoryname as I wrote.More here.