Simple example of using Collapse-Commander with sub-elements:
[expand cid="3279" /]
Since 1.3.3 we can use order and orderby attributes
[expand cid="3279" orderby="title" order="ASC" /]
A Pluginoven Test Site
Simple example of using Collapse-Commander with sub-elements:
[expand cid="3279" /]
Since 1.3.3 we can use order and orderby attributes
[expand cid="3279" orderby="title" order="ASC" /]
This is a test to see if print-pro-matic can print an external URL:
[print-me url="https://docs.google.com/spreadsheets/d/e/2PACX-1vSC6kmo4lmXRBc7QHMmg_s2Dq4LBg0FHclszFjAhCW_wYo814nBWM_mQhAryRayPNdQJLCXw0gNVbPo/pubhtml"/]
There will be an issue with cross domain origin, however a url on the same domain can be printed:
[print-me url="https://spacedonkey.de/donkey/donkey-in-a-bucket/"/]
This is a test to see how print-o-matic and print-pro-matic handle targeting a non-existing element:
No element? no problem… do nothing.
Now what happens if we have one element that does not exist in a list of elements:
As of print-o-matic version 2.0.1 the ability to use class to target a print element in external print triggers has been added. Basically it works the same as using the data-print_target attribute but instead uses a unique classname in the format of printtarget-<target_id>.
Create a target element. The element below is a div with an id of ‘my_print_target’:
<div id="my_print_target">This is the print target wrapped in a div with an element of 'my_print_target' as explained above</div>
Add an external trigger using the new class-trigger method. We’ll use a simple button like so:
<button id="my_print_button" class="printomatic printtarget-#my_print_target">Print Trigger</button>
Like in the original example, we need to add the hidden print trigger using a print-me shortcode with the same id as our external trigger and a printstyle=”external” attribute:
[print-me id="my_print_button" printstyle="external"/]
Quick test to demonstrate how to use the tag and css to control the look of a trigger.
[expand title="trigger" tag="h4"]hidden target content[/expand]
h4.collapseomatic {
color: blue;
}
This is an example of a simple expand element with an excerpt:
[expand title="Trigger Text" excerpt="The excerpt"]Hidden Content[/expand]
The excerpt can be repositioned above the trigger by adding excerptpos=”above-trigger” like so:
[expand title="Trigger Text" excerpt="The excerpt" excerptpos="above-trigger"]Hidden Content[/expand]
The following CSS can be used to control the vertical spacing between the three components. So that we don’t adjust all expand elements, the first step is to provide a unique class for each component:
[expand title="Trigger Text" excerpt="The excerpt" excerptpos="above-trigger" trigclass="skinny_trig" excerptclass="skinny_excerpt" targclass="skinny_targ" ]Hidden Content[/expand]
Now each can be controlled using the following css classes:
.skinny_trig {
border: 1px dotted red;
}
.skinny_excerpt {
border: 1px dotted green;
}
.skinny_targ {
border: 1px dotted blue;
}
That results in borders around each:
to make things as compact as possible, we remove the following padding and margins:
.skinny_trig {
/* border: 1px dotted red; */
padding: 0 0 0 10px;
line-height: .9;
}
.skinny_excerpt {
/* border: 1px dotted green; */
line-height: .8;
}
.skinny_targ {
/* border: 1px dotted blue; */
margin: 0;
line-height: .8;
}
And the final results are:
The goal is to change an ugly archive url into a pretty url. For example here is a quarterly custom post type archive:
The links are in a format of:
https://spacedonkey.de/date/2012/?q=4&post_type=monkey
And they would look better with something like:
https://spacedonkey.de/monkey/2012/Q4
To accomplish this, first the Add rewrite rules must be checked on the Archive-Pro-Matic settings page:
After the CPT Rewrite Rules has been checked and saved. It might be necessary to flush the rewrite rules by simply navigating to:
Dashboard > Settings > Permalinks – do nothing, and re-save the permalink settings.
Second a custom url rewrite function must be added to the child-theme’s function.php file. This function uses a new filter that has been added to manually overwrite the url that archive-pro-matic uses:
add_filter('apm_archive_link', 'pretty_my_archive_url');
function pretty_my_archive_url($url){
$url_args = explode('?', $url);
if(!empty($url_args[1])){
parse_str($url_args[1], $args);
if(!empty($args['year']) && !empty($args['q'])){
$url = $url_args[0].$args['year'].'/Q'.$args['q'].'/';
}
}
return $url;
}
Now, when we display a quarterly archive for a custom post type, the urls are prettier:
[archives type="quarterly" post_type="donkey" /]
And here is a test of just using the standard yearly archive for a custom post type:
[archives post_type="donkey" /]
Test to see if a single category can be excluded from an archive list.
[archives type="monthly" cat_id="-51"/]
This is a test of a monthly archive that displays a sub-list of post-by-post archives.
[archives type="postbypost" sub_options="true" limit="10"/]
Here are examples of limiting by category. First, using cat_id
[archives type="postbypost" sub_options="true" cat_id="55" limit="10"/]
Next, Using taxonomy and term. This pair can be used for any taxonomy, including category:
[archives type="postbypost" sub_options="true" taxonomy="category" term="archive-pro-matic" limit="10"/]
Testing the new link_atts attribute in archive-pro-matic
[archives type="birthmonth" order="ASC" class="grid" link_atts="target='_blank'"/]
[archives type="yearly" cat_id="1" show_post_count="true" /]