This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
...header and nav.. | |
<div id="wrapper"> | |
<div id="content"{block:PermalinkPage} class="single"{/block:PermalinkPage}> | |
{block:IndexPage}<div class="hellyeah">{/block:IndexPage} | |
{block:Posts} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="wrapper"> | |
<div id="content"{block:PermalinkPage} class="single"{/block:PermalinkPage}> | |
{block:IndexPage}<div class="hellyeah">{/block:IndexPage} | |
{block:Posts} | |
{block:Photo} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add an else statement in case the number is divisible by 5. | |
// for the numbers 1 through 20, | |
for (i=1; i<=20; i++) { | |
// if the number is divisible by 3, write "Fizz" | |
if ( i % 3 === 0 ) { | |
// if the number is divisible by 3 and 5, write "FizzBuzz" | |
if ( i % 5 === 0 ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Want my newsroom to be url.com/newsroom (currently throws a 404) | |
Posts should be url.com/newsroom/post-title (currently works) | |
Code in functions.php: | |
// newsroom custom content type | |
function bment_post_type_newsroom() { | |
register_post_type( | |
'newsroom', array( | |
'labels' => array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Process: Adobe Photoshop CS6 [516] | |
Path: /Applications/Adobe CS6/*/Adobe Photoshop CS6.app/Contents/MacOS/Adobe Photoshop CS6 | |
Identifier: com.adobe.Photoshop | |
Version: 13.0.0 (20120305.m.415) | |
Code Type: X86-64 (Native) | |
Parent Process: launchd [267] | |
Date/Time: 2012-03-23 10:12:33.059 -0400 | |
OS Version: Mac OS X 10.7.3 (11D50b) | |
Report Version: 9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In WP functions.php: | |
function get_post_id() { global $wp_query; $id = $wp_query->post->ID; return $id; } | |
function opengraph_thumbnail(){ | |
if (is_single()) { | |
echo get_the_post_thumbnail(get_post_id()); | |
} else { | |
echo imagedir() ?>/about_better.png <?php ; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Currently I have: | |
localhost/about/jobs - this works, displays list of job posts | |
localhost/about/jobs/taxonomy - 404 error (even with taxonomy.php) | |
localhost/about/jobs/job-post-title - works fine | |
//Custom post type for jobs | |
function bment_post_type_jobs() { | |
register_post_type( | |
'jobs', array( | |
'labels' => array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript">var submitted=false;</script> | |
//This is where thank you page/message is loaded. Replace onload function with jQuery hide/show or page redirect to separate page {window.location='thankyou.html';}. | |
<iframe name="hidden_iframe" id="hidden_iframe" style="display:none;" onload="if(submitted) {$('#formblock').hide(); $('#thankyou').fadeIn('fast');}"></iframe> | |
//replace form key with actual key from Google Docs | |
<form action="https://docs.google.com/a/betterment.com/spreadsheet/formResponse?formkey=dGlUczJTRUNjaHExOGtqZkVCYjVtR3c6MQ&ifq" method="post" target="hidden_iframe" id="commentForm" onsubmit="submitted=true;"> | |
<div id="formblock"> | |
//recreate form fields and validation if needed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Have two taxonomies. Both work in WP admin, and can be displayed with get_the_term_list(). But one won't work with wp_tag_cloud(). | |
Working taxonomy: | |
add_action( 'init', 'create_post_flags' ); | |
function create_post_flags() { | |
$labels = array( | |
'name' => _x( 'Post Flags', 'taxonomy general name' ), | |
'singular_name' => _x( 'Post Flag', 'taxonomy singular name' ), | |
'search_items' => __( 'Search Post Flags' ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In functions.php: | |
function get_taxonomy() { | |
$taxonomy = wp_get_object_terms( $post->ID, '[taxonomy]', array("fields" => "names") ); | |
$taxonomy = $taxonomy[0]; | |
echo $taxonomy; | |
} |
OlderNewer