Forum Replies Created

Viewing 15 replies - 1 through 15 (of 571 total)
  • Plugin Author vicchi

    (@vicchi)

    Hi there,

    If you want to modify the plugin’s widget strapline you don’t need a Factual API account; this is only needed if you’re going to be using the [wpq_locality] or [wp_quadratum_locality] short-codes.

    To modify the strap-line, you’ll need to code a filter hook function in PHP that will be invoked when the plugin calls the wp_quadratum_strapline filter as part of one of your pages loading.

    That means you’ll need to have a reasonable knowledge of how the WordPress filter and hook mechanism works and how to code a function in PHP that does what you need to do.

    The quickest way to do this is to install another plugin that allows you to run custom PHP scripts; WP Customizer can do this for you (as well as loading custom JavaScript and CSS as well; custom JavaScript won’t be needed for this but custom CSS might if you’re not happy with how the strap-line is styled). For transparency’s sake, this plugin is also one of mine, which I wrote as a convenient way to answer this sort of question. You’ll find more detail on the thinking behind this plugin and how to use it here.

    After installing and activating the plugin, you’ll need to enable custom front-end functions, then create a PHP source file called strapline.php in a subdirectory called functions which will be located in the directory that contains your WordPress root.

    In strapline.php, you can then copy and paste the sample filter hook that’s in the plugin’s documentation. It looks like this …

    <?php
    add_filter('wp_quadratum_strapline', 'format_strapline', 10, 2);
    function format_strapline($content, $params) {
        // $params = array (
        //      'venue-url' => '4Sq venue url for checkin',
        //      'venue-name' => 'checkin venue name',
        //      'checked-in-at' => 'timestamp of checkin'
        //  );
    
        $strapline = '<h5>Last seen at <a href="' . $params['venue-url'] . '" target="_blank">' . $params['venue-name'] . '</a> on ' . date('l jS \of F Y h:i:s A', $params['checked-in-at']) . '</h5>';
        return $strapline;
    }
    ?>

    This will give you a working implementation of the strap line filter. You’ll then need to amend the value of the $strapline variable to give you the format and display you need.

    Hope this helps

    -Gary

    Plugin Author vicchi

    (@vicchi)

    It sounds like there’s a clash in the user_contactmethods array with the Open Graph plugin in much the same way as there was with the WordPress SEO plugin.

    This is very helpful. I was able to code around the WordPress SEO plugin (indeed I had to as that plugin’s author never responded to emails or forum posts). Without looking at the Open Graph plugin I can’t say that I can work around this the same way but it seems a reasonable assumption.

    I’ll take a look at this when I’m able to find some time to work on the next release of WP Biographia.

    -Gary

    Plugin Author vicchi

    (@vicchi)

    There’s quite a lot going on here, but I’ll try and break it down into chunks.

    A very high proportion of the customization advice you’ll find on the web starts with these lines … add the following to the end of your theme’s functions.php or even worse, advises that you modify the source code of your theme or your plugins. This is bad for many reasons:

    • Editing your theme’s functions.php makes theme specific customizations; change your theme and your customizations will no longer get loaded.
    • When your theme and plugins get updated you’ll find all your careful hand crafted customizations get overwritten and lost.
    • A lot of theme and plugin authors won’t offer support for changes you might have made to the source code.
    • Your customizations might work; but you might also inadvertently make some other changes which will stop things working.

    In the case of WP Biographia, the plugin loads minified versions of the CSS and JavaScript it uses to help improve load time, so even if you do make changes, they won’t be reflected until you (re)minify the source.

    I’d recommend you separate your custom CSS into a separate source file and load that into your WordPress install; you can use the WP Customizer plugin to do this (in the interest of transparency I should point out that this is another one of my plugins).

    From reading your experiences it also sounds like there’s some caching going on. Possibly in your browser. Possibly in your WordPress install via a caching plugin?

    Hope this helps

    -Gary

    Plugin Author vicchi

    (@vicchi)

    I would like to display only to some users.

    You can specify which user’s have the Biography Box suppressed via the plugin’s Exclusions tab; scroll down and you’ll see a section marked User Hiding Settings, but note that this only takes effect for single post or custom post types, not for archive pages or the front page.

    I would like to display box above post title too, but I read and not undestand the support about that … Do you have some code that I can use? And how to put in the editor theme? Is it possible?

    Yes, this is possible. But you will need to write some code to do this. The plugin works by appending or prepending the Biography Box to a post’s content. By the time the plugin’s code is called the post’s title has already been emitted by WordPress. What you’d need to do is to look at the templates in your theme, work out where the post title is handled and use one of the plugin’s template tags to emit the Biography Box. You’d need to disable the plugin automatically doing this in the settings as well as do this for each template you have.

    It’s possible, but not trivial and certainly not a copy-and-paste exercise. How you’d go about this really depends on which theme you’re using and how that theme is structured. Most free themes follow a standard pattern for theme layout and structure but a lot of premium themes don’t.

    -Gary

    Plugin Author vicchi

    (@vicchi)

    Hmmm … maybe I’m missing something here, but if you’re using WP Biographia to add a user’s biography to your site, why would you want an author box from your theme to be there as well, or perhaps vice versa?

    -Gary

    Plugin Author vicchi

    (@vicchi)

    How do I activate the Custom Post Type to be displayed on the link “More Posts”

    From within the plugin, this isn’t something you can do. The More Posts link is simply what the WordPress get_author_posts_url API call returns, which in turn gives you the archive page URL for the post’s author in the form [blog URL]/author/[author name].

    You can make a modified author template, preferably via a child theme, to do this, writing a custom WordPress Loop to bring in the custom post type that you require, rather than the usual default post post type.

    Would it be possible to display thumbnails of the custom type (portfolios in my case) into the Biographia box?

    You might be able to do this via the plugin’s wp_biographia_biography_box filter, appending the thumbnails the the Biography Box’s content, but you’d need to write some custom code to be able to do this.

    Hope all of the above helps …

    -Gary

    Plugin Author vicchi

    (@vicchi)

    In that case I’ll try and hack a sample together for you over the next couple of days.

    -Gary

    Plugin Author vicchi

    (@vicchi)

    You shouldn’t need to hack the plugin’s PHP or read it (unless you really want to).

    My thinking here is that you hook into the wp_biographia_biography_box filter (see https://www.vicchi.org/codeage/wp-biographia/5-filter-support-and-usage/) and check whether this is a single post via the is_single() API call. If this returns true you can then remove the paragraphs within the wp-biographia-text div to remove the biography text. Alternatively you can hook into the wp_print_styles action hook and load some custom CSS if this is a single post to set the CSS for wp-biographia-text.p to hidden.

    It’ll need some knowledge of PHP and CSS and how WordPress queues action and filter hooks though; I’ve no idea how much knowledge you have of this. If the answer is “none” I can try and hack together some sample code which should work for you.

    -Gary

    Plugin Author vicchi

    (@vicchi)

    Hi,

    There is a global control for the display of the user’s biography in the Biography Box under Settings / WP Biographia / Content / Show User’s Biography. But this will affect all instances of the Biography Box, not just those on single posts.

    If you’ve only configured the plugin for single posts and not for any other post type this should work fine for you.

    But if not, then the plugin doesn’t support per post type customisations of this sort. You may be able to work around this using the plugin’s filters and writing some PHP to amend the Biography Box content though.

    -Gary

    Plugin Author vicchi

    (@vicchi)

    Just tried your single.php and the template tag is working perfectly for me. That’s kind of ruled out an issue with the theme and the plugin not playing well together. All of which suggests there might be a problem with another plugin … have you tried deactivating all of the others and seeing if this problem continues?

    Plugin Author vicchi

    (@vicchi)

    I’ve dug into this a bi deeper and I think it’s probably more a side effect of PHP’s security measures than a WordPress or plugin issue. If you’re running a version of PHP prior to 5.4, then magic_quotes_gpc is on by default and this will automagically escape single and double quote characters in form fields. From 5.4 onwards, WordPress also does this for you.

    You can use WP Biographia’s wp_biographia_content_title filter to remove any escaped characters in the Biography Box title before it’s displayed though. Using your example of L’autore as the Biography Box prefix, the following code displays this correctly and without the escaped single quote.

    add_filter('wp_biographia_content_title', 'bio_prefix_override', 10, 3);
    function bio_prefix_override($content, $prefix, $formatted_name) {
    	return stripslashes($content);
    }

    -Gary

    Plugin Author vicchi

    (@vicchi)

    Can you post the entirety of your single.php template on something like PasteBin so I can take a look at where you’ve placed the template tag in context? It looks like you’ve modified this template a bit and I want to ensure I’m trying to duplicate your set up as much as I can.

    -Gary

    Plugin Author vicchi

    (@vicchi)

    The use of the two filters I mentioned are the preferred and supported way of adding new contact links to the plugin’s Biography Box. As I mentioned in the FAQ …

    One of the wonderful things about today’s web is the vast amount of ways we have to interact with each other. I can’t keep up. No, really. In practical terms, this would mean that the plugin’s settings and options panels would soon get out of hand, plus the overhead of adding, testing and releasing a new version of the plugin would get out of hand before the settings and options do.

    For now at least, the contact links built into the plugin are going to stay as they are. I’ve got no plans to add additional contact links to the next version over and above the 10 additional social media links that are currently supported.

    That said, you’re not the first to ask for Instagram support and Pinterest support has also been requested. Dependent on the amount of time I have to put into the next version of the plugin, these may end up natively supported.

    But for now, the filters are the way to go if you need Instagram support.

    -Gary

    Plugin Author vicchi

    (@vicchi)

    I’ve downloaded the Silver Orchid theme and tried this out on my local install.

    The bad news is that I can’t seem to get the short code working. Which means you’ve probably found a bug. I need to do some more digging into the plugin’s code to see what’s going on here.

    The good news is that rather than have the overhead of getting WordPress to parse the short code, you can use one of the plugin’s template tags instead and this works just fine. This is actually the preferred way to get the placement of the Biography Box just as you want it in a theme’s template.

    The following code snippet is working in the theme’s single.php. Based on your earlier post, I’ve added the Biography Box in-between the entry div and the post-tags div.

    <div class="entry">
    	<?php the_content(); ?>
    </div> <!-- entry -->   
    
    <?php
    if (function_exists('wpb_the_biography_box')) {
    	wpb_the_biography_box();
    }
    ?>
    
    <div class="post-tags">
    	<?php the_tags(); ?>
    </div>

    … give this a try and let me know how you get on.

    -Gary

    Plugin Author vicchi

    (@vicchi)

    I’ll take a look at this; I think there might be some cleverness with either PHP or WordPress sanitising the form field content for the prefix string. Bear with me.

    -Gary

Viewing 15 replies - 1 through 15 (of 571 total)