snipt

Ctrl+h for KB shortcuts

PHP

Add custom CSS to Dynamik-based Genesis WP site

1
2
3
4
5
6
7
8
<?php
// Add custom CSS to Dynamik-based Genesis WP site
add_action ('wp_head', 'xmit_custom_css',92);
function xmit_custom_css() {
?>
<link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri(); ?>/xmit-custom.css" type="text/css" media="screen" />
<?php
}
https://snipt.net/embed/03e66ada63aa1fa21885874073a846ff/
https://snipt.net/raw/03e66ada63aa1fa21885874073a846ff/
03e66ada63aa1fa21885874073a846ff
php
PHP
8
2016-10-01T05:35:18
True
False
False
/api/public/snipt/47747/
add-custom-css-to-dynamik-based-genesis-wp-site
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a> <a href="#L-8">8</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?php</span> </span><span id="L-2"><a name="L-2"></a><span class="c1">// Add custom CSS to Dynamik-based Genesis WP site</span> </span><span id="L-3"><a name="L-3"></a><span class="nx">add_action</span> <span class="p">(</span><span class="s1">&#39;wp_head&#39;</span><span class="p">,</span> <span class="s1">&#39;xmit_custom_css&#39;</span><span class="p">,</span><span class="mi">92</span><span class="p">);</span> </span><span id="L-4"><a name="L-4"></a><span class="k">function</span> <span class="nf">xmit_custom_css</span><span class="p">()</span> <span class="p">{</span> </span><span id="L-5"><a name="L-5"></a><span class="cp">?&gt;</span><span class="x"></span> </span><span id="L-6"><a name="L-6"></a><span class="x">&lt;link rel=&quot;stylesheet&quot; href=&quot;</span><span class="cp">&lt;?php</span> <span class="k">echo</span> <span class="nx">get_stylesheet_directory_uri</span><span class="p">();</span> <span class="cp">?&gt;</span><span class="x">/xmit-custom.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;</span> </span><span id="L-7"><a name="L-7"></a><span class="cp">&lt;?php</span> </span><span id="L-8"><a name="L-8"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
dynamik, genesis, wordpress

PHP

add genesis seo and layout features to CPTs

1
2
3
4
5
6
<?php
// add Genesis features to custom post types
// put this in functions.php
add_post_type_support( 'CPTNAME', 'genesis-seo' );
add_post_type_support( 'CPTNAME', 'genesis-layouts' );
?>
https://snipt.net/embed/3a59cc09e3ebfd38dc30081c317832b8/
https://snipt.net/raw/3a59cc09e3ebfd38dc30081c317832b8/
3a59cc09e3ebfd38dc30081c317832b8
php
PHP
6
2016-09-25T03:37:08
True
False
False
/api/public/snipt/38308/
add-genesis-seo-and-layout-features-to-cpts
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?php</span> </span><span id="L-2"><a name="L-2"></a><span class="c1">// add Genesis features to custom post types</span> </span><span id="L-3"><a name="L-3"></a><span class="c1">// put this in functions.php</span> </span><span id="L-4"><a name="L-4"></a><span class="nx">add_post_type_support</span><span class="p">(</span> <span class="s1">&#39;CPTNAME&#39;</span><span class="p">,</span> <span class="s1">&#39;genesis-seo&#39;</span> <span class="p">);</span> </span><span id="L-5"><a name="L-5"></a><span class="nx">add_post_type_support</span><span class="p">(</span> <span class="s1">&#39;CPTNAME&#39;</span><span class="p">,</span> <span class="s1">&#39;genesis-layouts&#39;</span> <span class="p">);</span> </span><span id="L-6"><a name="L-6"></a><span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
"custom post type", genesis, wordpress
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.