Giorgio25b
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [Customizr] Custom Post Type Archive TemplateThanks all for this!
One more thing Tim,
you mentioned:The custom meta box is dealt with in a separate part of the plugin. It’s not really created when the CPT is, so I kept is separate:
add_meta_box( 'ct_Website_text_550e', // $id 'Website', // $title 'show_custom_meta_box', // $callback 'site', // $page 'normal', // $context 'high' // $priority );
Can you please give me more details about the title meta-box? Did u write your own plugin? where did u put that code?
I’m asking it because I’m trying to achieve the same result but for regular posts listForum: Themes and Templates
In reply to: [Customizr] Changing the colors of the submit buttonsHi h2b,
I’m assuming you already changed the color for the class .btn-primary, now you need to customize the :hover state.btn-primary.active, .btn-primary.disabled, .btn-primary:active, .btn-primary:focus, .btn-primary:hover, .btn-primary[disabled] { background-color: #999999 !important; color: #fff; }
note that in this case !important is necessary to avoid the main theme overriding your settings and pf course you have to change the #999999 with the color you wish
Forum: Themes and Templates
In reply to: [Customizr] Custom Post Type Archive TemplateOk, I’ll try to dig into it next vacation days.
PHP and WP are getting more and more complex every day, we need to keep up!
If you come up with a solution earlier let me know ??
Forum: Themes and Templates
In reply to: [Customizr] Internet Explorer Problems with Customizr ThemeI’ve tested and i woks with a different and easier js function.
So, to summarize with the updated code:You have to create a js file e.g. “ie-script.js” and paste into it this code:
var div = document.createElement("div"); div.innerHTML = "<!--[if lt IE 9]><i></i><![endif]-->"; var isIeLessThan9 = (div.getElementsByTagName("i").length == 1); if (isIeLessThan9) { alert("YOUR IE VERSION SHOULD BE IE9 OR ABOVE"); }
It gives a popup alert if you are using IE8 or below.
Than you’ll need to enqueue “ie-script.js” through the php function below that has to go into your functions.php:
function ie_scripts() { wp_enqueue_style( 'style-name', get_stylesheet_uri() ); wp_enqueue_script( 'script-name', 'https://localhost/dropbox/grc-local/wordpress/learning-site/wordpress/wp-content/themes/customizr-child/ie-script.js', array(), '1.0.0', true ); } add_action( 'wp_enqueue_scripts', 'ie_scripts' );
hope it helps
Forum: Themes and Templates
In reply to: [Customizr] Internet Explorer Problems with Customizr Theme@ Momo2Mimo
I’m sorry, I’ve failed to mention that the previous js code can not run into the functions.php
One is a js and the other one is php!
You have to create a js file e.g. “ie-script.js” and paste into it the above code.Than you’ll need to enqueue “ie-script.js” through a function that has to go into your functions.php
something like this:
/** * Proper way to enqueue scripts and styles */ function ie_scripts() { wp_enqueue_style( 'style-name', get_stylesheet_uri() ); wp_enqueue_script( 'script-name', 'your-child-them-path/ie-script.js', array(), '1.0.0', true ); } add_action( 'wp_enqueue_scripts', 'ie_scripts' );
again, I did not test it. So theoretically speaking should do the job.
Forum: Themes and Templates
In reply to: [Customizr] Internet Explorer Problems with Customizr Themethis is updated to IE11 and even less tested than the previous snippet, test it locally before deploying it for the public!
function getInternetExplorerVersion() // Returns the version of Internet Explorer or a -1 // (indicating the use of another browser). { var rv = -1; // Return value assumes failure. if (navigator.appName == 'Microsoft Internet Explorer') { var ua = navigator.userAgent; var re = new RegExp("MSIE ([0-11]{1,}[\.0-11]{0,})"); if (re.exec(ua) != null) rv = parseFloat( RegExp.$1 ); } return rv; } function checkVersion() { var msg = "You're not using Internet Explorer."; var ver = getInternetExplorerVersion(); if ( ver > -1 ) { if ( ver >= 9.0 ) msg = "You're using a recent copy of Internet Explorer." else msg = "You should upgrade your copy of Internet Explorer."; } alert( msg ); }
Forum: Themes and Templates
In reply to: [Customizr] Internet Explorer Problems with Customizr ThemeYou can try this function to be copied in your functions.php, still assuming you are using a child-theme
function getInternetExplorerVersion() // Returns the version of Internet Explorer or a -1 // (indicating the use of another browser). { var rv = -1; // Return value assumes failure. if (navigator.appName == 'Microsoft Internet Explorer') { var ua = navigator.userAgent; var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); if (re.exec(ua) != null) rv = parseFloat( RegExp.$1 ); } return rv; } function checkVersion() { var msg = "You're not using Internet Explorer."; var ver = getInternetExplorerVersion(); if ( ver > -1 ) { if ( ver >= 9.0 ) msg = "You're using a recent copy of Internet Explorer." else msg = "You should upgrade your copy of Internet Explorer."; } alert( msg ); }
I did not test it recently, it is an old snippet for when we used to waste our time for IE users ??
In case you need help with the child-theme here is a perfect tutorial for it:
Creating a child theme for CustomizrHope it helps
Forum: Themes and Templates
In reply to: [Customizr] Custom Post Type Archive TemplateI’m going to knock off for the WE.
I was able to double the title link, but it does not link outside wordpress. ??I’m working on this piece of code:
function tc_content_heading_title( $_title ) { //Must be in the loop if ( ! in_the_loop() ) return $_title; //gets the post/page title if ( is_singular() || ! apply_filters('tc_display_link_for_post_titles' , true ) ) return is_null($_title) ? apply_filters( 'tc_no_title_post', __( '{no title} Read the post »' , 'customizr' ) ) : $_title; else return sprintf('<a href="%1$s" title="%2$s" rel="bookmark">%3$s</a>', get_permalink(), sprintf( apply_filters( 'tc_post_link_title' , __( 'Permalink to %s' , 'customizr' ) ) , esc_attr( strip_tags( $_title ) ) ), is_null($_title) ? apply_filters( 'tc_no_title_post', __( '{no title} Read the post »' , 'customizr' ) ) : $_title );//end sprintf }
It is annoying though! Way more complicated than expected.
Customizr has this super hooked loop that is tricky to customize.In the documentation when they explain their loop there is this link:
Three techniques to alter the query in WordPressForum: Themes and Templates
In reply to: [Customizr] Custom Post Type Archive TemplateSounds good to me ??
So here is the 2012 tutorial (sorry for saying 2013!)
How to Link to External Links from the Post TitleIt gives a clear idea of what you need to do with custom fields and loop.
If you succeed please share your solution; I have no time right now, but I would try also ACF to create a custom solution.
Good luck
Forum: Themes and Templates
In reply to: [Customizr] Custom Post Type Archive TemplateHey Tim,
there are several ways to achieve your goal:
-hard coding functions.php and index.php with custom loops
-using SEO plugins to redirect each post to a specific url
-using this plugin: Page Links ToNow you have to understand that this topic is on the discussion table since 10 years: WP forum 2004
So my recommendation is to consider pros and cons; if for e.g. you are already using the YOAST SEO plugin you should use it also to redirect those posts saving a lot of time in customizing your loop.
If you wanna go for the hard way, coding your loop, I can point you in a certain direction with a 2013 tutorial.
Your call,
let us know!Forum: Themes and Templates
In reply to: [Customizr] Internet Explorer Problems with Customizr ThemeCustomizr works well with IE9 and above, for IE8 there are some custom settings(classes starting with .ie8 )though the limitation of IE8 is huge!
If you wanna use IE it has to be IE9 or above, it would be very painful rendering properly all your settings on IE8.
And keep on mind that in the next few months Microsoft will cut-off IE8 support and development, there is really no point in wasting energy for it!
All the above version of IE are working just great with Customizr
Forum: Themes and Templates
In reply to: [Customizr] Missing FooterIt is a bit odd the situation, but we need more info from your side:
do you have actually widgets in the footer area?
If yes, did u try to add a calendar or a search widget to see if they show?
Did u try to disable one by one all your plugins?Give it a shot and get back to us here.
ThanksForum: Themes and Templates
In reply to: [Customizr] Internet Explorer ProblemsHey Momo2Mimo
I’ve replied to your question here,
please mark this one as resolved so we can continue only on the other:
duplicated treadForum: Themes and Templates
In reply to: [Customizr] How can I change the posting date textHi Savalou,
there is a handy tutorial to do that:
Change meta textHope it helps
Forum: Themes and Templates
In reply to: [Customizr] Custom Post Type Archive TemplateHi Tim,
you can use the the custom-page.php, rename it and give it a proper name in the header.Depending on what you wanna do, in your loop you have to declare the name of your custom-post-type with
‘post-type’ => ‘your-cpt-name’Here is an example for my CPT called ‘projects’
<?php $args = array( 'posts_per_page' => -1, 'post_type' => 'projects' ); query_posts($args); ?>
Hope it helps