Forum Replies Created

Viewing 15 replies - 226 through 240 (of 281 total)
  • Thanks 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 list

    Hi 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

    Ok, 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 ??

    I’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

    @ 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.

    this 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 );
    }

    You 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 Customizr

    Hope it helps

    I’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 &raquo;' , '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 &raquo;' , '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 WordPress

    Sounds good to me ??

    So here is the 2012 tutorial (sorry for saying 2013!)
    How to Link to External Links from the Post Title

    It 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

    Hey 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 To

    Now 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!

    Customizr 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

    @icedc

    It 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.
    Thanks

    Hey Momo2Mimo

    I’ve replied to your question here,
    please mark this one as resolved so we can continue only on the other:
    duplicated tread

    Hi Savalou,
    there is a handy tutorial to do that:
    Change meta text

    Hope it helps

    Hi 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

Viewing 15 replies - 226 through 240 (of 281 total)