DaveE
Forum Replies Created
-
Hi Nick,
Since we’re in a sidebar and not within the “main” loop, the global $post variable isn’t available for your call to
get_post_custom
. Try getting the ID for the current post being looped through and using that in your call like this:get_post_custom( get_the_ID() )
Alternatively, you could use
get_post_meta()
instead ofget_post_custom()
like this:$description-presentation = $get_post_meta( get_the_ID(), 'description-presentation' );
.Using
get_post_meta()
saves you having to find the description keys in the full set of meta key/values for the post.get_the_ID()
reference: https://codex.www.ads-software.com/Function_Reference/get_the_IDget_post_meta()
reference: https://codex.www.ads-software.com/Function_Reference/get_post_metaCheers!
@gavitylover,
If you had viewed my pastebin link above, you’ll see that the URL you reference is the one that I had implemented. I’m not sure what your point is regarding the correct URL for SSL.
Thanks for the tip regarding other locations. However, if the wp-admin area isn’t SSL secured, then there is no reason to use the SSL URL’s in the Charts API code. Hence, the HTTPS check in the pastebin (above).
Cheers!
Forum: Plugins
In reply to: [Flexible Posts Widget] [Plugin: Flexible Posts Widget] Is excerpt possible?Hi Mistu,
The plugin is meant to allow for advanced templating configurations using the custom template options, including adjusting the excerpt length on your own. If you’d like to set a different excerpt length for the widget and not for your regular posts, you’ll probably want to investigate using some simple PHP functions to do so.
Adding a custom excerpt length setting to the plugin doesn’t really make sense because the custom templates may or may not use an excerpt at all. That’s really the benefit of allowing custom templates – users can modify the widget output however they would like.
Sorry I’m not more help to you.
Forum: Plugins
In reply to: [Flexible Posts Widget] [Plugin: Flexible Posts Widget] Title too long…Hi enriart,
Unfortunately, that’s really beyond the nature of the plugin. If you’re at all comfortable with WordPress’s templates, you could learn the PHP you need pretty quickly. Here are a couple possible solutions I managed to Google up:
- https://stackoverflow.com/a/80066/1135190
- https://technorati.com/technology/it/article/how-to-use-phps-substr-function/
You’d want to start by following the instructions for using a custom output template in your theme’s folder: https://www.ads-software.com/extend/plugins/flexible-posts-widget/installation/. And then use the examples I linked to above to replace
the_title
in your theme’s FPW template.I hope that helps!
Forum: Plugins
In reply to: [Flexible Posts Widget] [Plugin: Flexible Posts Widget] Is excerpt possible?Ah yes, good catch. ??
Forum: Plugins
In reply to: [Flexible Posts Widget] [Plugin: Flexible Posts Widget] Is excerpt possible?Sure, in your custom template at the location you’d like to show the excerpt just insert this PHP:
<?php the_exerpt(); ?>
. It works the same was as the PHP<?php the_title(); ?>
within the default FPW template.Of course for these PHP functions to work you need to be in the FPW WordPress loop (https://codex.www.ads-software.com/The_Loop). That means it needs to be added somewhere between the following two lines in your template.
After this line:
<?php while ( $flexible_posts->have_posts() ) : $flexible_posts->the_post(); ?>
And before this line:
<?php endwhile; ?>
Cheers!
Forum: Plugins
In reply to: [Flexible Posts Widget] [Plugin: Flexible Posts Widget] Is excerpt possible?Hi Mistu,
The plugin already allows you to define your own display templates. Much like WordPress’s own templates, you can adjust what gets displayed for each widget. You can use any standard WordPress loop/post functions, including
the_excerpt
within those custom templates.The instructions for creating your own FPW template(s) are here: https://www.ads-software.com/extend/plugins/flexible-posts-widget/installation/.
Hope that helps!
Forum: Plugins
In reply to: [Flexible Posts Widget] [Plugin: Flexible Posts Widget] Is Offset possible?I’ve added an offset option to widget. Please update to the latest version to see the added functionality. Cheers!
Forum: Plugins
In reply to: [Flexible Posts Widget] [Plugin: Flexible Posts Widget] Is Offset possible?Hi netingenuity,
It’s not currently possible with the plugin, but that’s an excellent feature suggestion. I’ll add it to the list of improvements I’m making. I should have a new version out in a week or two that will include that capability.
Thanks for suggesting it!
DaveE
Forum: Plugins
In reply to: [Flexible Posts Widget] [Plugin: Flexible Posts Widget] Indivdual templateHi flomar,
Per the instructions, the folder name inside your theme root needs to be
flexible-posts-widget
, notviews
as it is inside the plugin. This is because there are many plugins that feature theme-customizable templates and we need to know which template goes with which plugin.Cheers,
DaveE
Forum: Plugins
In reply to: [Flexible Posts Widget] [Plugin: Flexible Posts Widget] last post in the listHi Elvis,
As the plugin documentation states, you can create you own templates with whatever output you’d like. See the section titled “To use a customized HTML output template” here: https://www.ads-software.com/extend/plugins/flexible-posts-widget/installation/.
Alternatively, if you’re looking to style the last post differently, you can accomplish this with CSS using the
last-of-type
selector: https://www.w3schools.com/cssref/sel_last-of-type.asp.Hope that helps,
DaveE
Forum: Plugins
In reply to: [Flexible Posts Widget] [Plugin: Flexible Posts Widget] Multiple taxonomiesSarah,
As the plugin documentation states, you can create you own templates with whatever information you’d like to display from each post. See the section titled “To use a customized HTML output template” here: https://www.ads-software.com/extend/plugins/flexible-posts-widget/installation/
Forum: Plugins
In reply to: [The Events Calendar] [Plugin: The Events Calendar] Event Permalinks FlakyHi roblagatta,
No worries about the delayed response. Next time the issue occurs, I’ll try tweaking the permalink settings to see if that helps. Honestly, the site doesn’t update events all that often, so it may be a while before the issue occurs again. For now, we’ll just chalk it up to a bad theme or some other conflict.
Thanks again for the input. I’ll report back here if it happens again.
Forum: Plugins
In reply to: [Flexible Posts Widget] [Plugin: Flexible Posts Widget] Multiple taxonomiesSarah,
The plugin already supports custom post types. You can get posts by a specific post type or by taxonomy & term.
Hi Winstonion,
WordPress stores widget options (and many other values) in the database as serialized strings. In order to update those values correctly, you’d need to unserialize the string, update it and then re-serialize it before replacing the value in the DB.
When the serialized data gets corrupted (by performing a MySQL update directly on the serialized data) the widget or other item using that data is essentially ignored by WordPress. Hence, you widgets have disappeared.
To recover the widgets that have been lost, you may be able to just re-update the DB value back to the initial ‘widget.php’. This may or may not work depending on how corrupted the data became. You could also revert to a backup of the DB or specific DB table if you have that.
Here’s a bit of an explanation from Nacin regarding WP’s serialized strings:
https://nacin.com/2010/04/18/wordpress-serializing-data/And here’s a tool/PHP script that you can use to update serialized data in the DB:
https://interconnectit.com/124/search-and-replace-for-wordpress-databases/Hopefully that helps.