Manuel Schmalstieg
Forum Replies Created
-
Forum: Alpha/Beta/RC
In reply to: Function for neighbouring posts, broken by 3.1-beta1Thanks Demetris for your observations. The built-in “next/prev” function is useful indeed, and your little tweak above could be very practical. But in some situations, such as a CMS-like site that strongly relies on categories, it’s necessary to be able to show a complete category listing.
I wasn’t aware of the phpdoc subsite, so thanks for letting me know!
Regarding the WP 3.1 issues I mentionned, it looks like they are both linked to modifications affecting the
get_category
function… see https://core.trac.www.ads-software.com/ticket/15442 to follow the discussion.So I guess we can only wait and see.
Forum: Plugins
In reply to: Facebook "like" that validatesIf you google a bit on that topic, you will notice that the workarounds consist in hiding the Facebook code by
<!-- commenting it out -->
or writing it with javascript … but the code itself wont’ be W3C valid anyway.Consequently, achieving validation by hiding stuff from the validator won’t really make your code better or more accessible. Personally I would rather live with it, and use the W3C validator to detect mistakes that can be corrected.
Forum: Alpha/Beta/RC
In reply to: Function for neighbouring posts, broken by 3.1-beta1As an aside, it would be great if we could find in the Codex documentation more concrete examples of “how to get things done”, which would be trusted methods that won’t become invalidated by updates.
Examples of such functions that come to my mind:
– Displaying image-attachments in a custom manner. The best sample code that I found so far is not in the codex, but in this blog: https://digwp.com/2009/08/awesome-image-attachment-recipes-for-wordpress/
– Creating a simple breadcrumb trail. The solution I used until now was based on this: https://dimox.net/wordpress-breadcrumbs-without-a-plugin/ — it doesn’t work in the latest 3.1-beta.
– Displaying posts that share the same parent categories as the current post. The solution I used until now: see above. Broken by 3.1-beta.
In other words: I certainly do appreciate the diversity of the WordPress eco-system, but sometimes I wish there would be a more centralized “cook-book” where theme developers can look for tested, documented and reliable recipes, rather than finding 10 different custom solutions that may or may not be future-proof…
Or maybe I should urge the authors of the above solutions to integrate their examples into the Codex, and see what happens ?
Forum: Alpha/Beta/RC
In reply to: Can Post Format have "custom inputs"?Right, from what I’m reading, it seems more and more clear that the UI is not supposed to be tweaked. Those Post Formats are really just an additional way to categorize posts. The main benefit appears to be portability across different themes.
More info:
– https://core.trac.www.ads-software.com/ticket/14746
– https://wpdevel.wordpress.com/tag/post-formats/Forum: Alpha/Beta/RC
In reply to: Can Post Format have "custom inputs"?Maybe that’s the intent of those post formats, indeed. But the codex page suggests that the UI for different formats may differ:
https://codex.www.ads-software.com/Post_FormatsQuote: Suggested UI is a quote text area and a citation textarea.
My practical usage example: the “Video” post format will be styled and behave exactly as a normal post, but it will have a bunch of custom input fields:
* jpeg caption
* source file – webm
* source file – ogg/ogv
* source file – h264/m4v
* video width
* video height
* video duration
* subtitles en
* subtitles alternate languageMy theme will be set up to produce a custom video player, using the input from those fields. I could add all those as custom fields, but i don’t want them to clutter the custom fields dropdown menu for ordinary posts. Also, having all the fields exposed upfront should make the editor’s task easier.
Forum: Themes and Templates
In reply to: php relational operators : several values after !=Yes, that’s exactly what I was looking for.
So simple.
Thanks a lot!Forum: Fixing WordPress
In reply to: Change wp-contentand what about the method explained here: https://www.nexwp.com/stories/how-to-protect-the-wp-content-folder-of-wordpress ??
it seems to work quite nicely.Forum: Themes and Templates
In reply to: Have I missed the point of WordPress?FYI, here is the built-in WordPress function that allows you to create a login-link that will redirect the user wherever you want:
https://codex.www.ads-software.com/Function_Reference/wp_login_url
Forum: Plugins
In reply to: Is it possible?i’m not a php expert, but i would give a try to the examples found here:
https://www.php.net/manual/en/function.preg-match.phpExamples #1 and #2 seem quite practical to implement, using the
the_title_attribute('echo=0');
variable…Forum: Themes and Templates
In reply to: Remove post titleWhen the categories are shown, WordPress will use either
category.php
or, if that file doesn’t exist,archive.php
– so you need to customize those as well.At that point, you should have a look at the WordPress template hierarchy to get a better understanding of your theme.
When I started customizing themes, I found this article a very useful starting point.
Forum: Themes and Templates
In reply to: php relational operators : several values after !=for the record, i am aware that this form is possible:
if ((($all_cats_of_post[$i]->cat_ID) != 8 ) && (($all_cats_of_post[$i]->cat_ID) != 10 ) && (($all_cats_of_post[$i]->cat_ID) != 13 ))
but I hope that there’s a less redundant way of formulating the same statement …
Forum: Plugins
In reply to: Recomend a pluggin to create a contact form?I have been using contact form 7 to my great satisfaction. I find it very flexible and easy to configure, and judging by the frequency of updates, it is well-maintained.
Forum: Themes and Templates
In reply to: Remove post title…or you could remove the line
echo $fake_title;
from the code above … which would mean that IF you define a FakeTitle, no post title gets displayed. And you would then add it manually inside your post.Forum: Themes and Templates
In reply to: Remove post titleIf i understand what you intend to do, the smartest thing might be to use a Custom Field (which you add to the post, below the editor interface). Let’s say you name it “FakeTitle”.
In your theme, you would modify the
single.php
file rather thanindex.php
(or perhaps both, depending if the fake title should appear on your front page as well).In your loop you would replace the
<?php the_title(); ?>
stuff with something like that:<?php $fake_title = get_post_meta($post->ID, 'FakeTitle', true); //get the FakeTitle field, if it exists if($fake_title !== '') { //if it exists echo $fake_title; //display the fake title } else { the_title(); //display the post title } ?>
Forum: Themes and Templates
In reply to: Problems with Images 2 – resizing using Twenty TenIf it’s an image placed inside a post, the easiest would be to:
- edit the post in HTML view
- insert your image at the appropriate place
- look at the generated code, locate the width and height values, and edit them. You may simply change the with, and set the heigth to “auto”, so the ratio will be kept.