Technical Support

I want these four courses to appear side by side instead of up and down and would like a box that says read more to appear under each picture under the name of each course. Can someone help me with the code?

Thanks,
Jeremy

  • Rupok
    • Support Ninja

    Hi Jeremy, hope you had a wonderful day.

    # Four courses to appear side by side ?
    # A box that says read more to appear under each picture under the name of each course ?
    You can do both by creating a MU Plugin. For creating a mu plugin, create a folder named "mu-plugins" inside your "wp-content" folder. Then inside that "mu-plugins" folder, create a file with any name and with a .php extension. Now paste the code inside that file and save.

    <?php
    add_action( 'wp_footer', 'course_list_modified' );
    function course_list_modified() {
        ?>
        <script type="text/javascript">
          jQuery(document).ready(function() {
    		if (jQuery('.archive-header').length > 0) {
    		    jQuery('.course.type-course').css({"float": "left", "width": "25%", "padding": "5px"});
    		    jQuery('.course-summary').css("display","none");
    		    jQuery('.entry-meta').css("display","none");
    		    jQuery('.course-start-date').css("display","none");
    		    jQuery('.course-language').css("display","none");
    		    jQuery('.course-cost').css("display","none");
    			jQuery('.apply-button').each(function() {
    			  var text = jQuery(this).text();
    			  jQuery(this).text(text.replace('Details', 'Read More...'));
    			});
    		}
          });
        </script>
        <?php
    }

    For getting more idea on mu plugins, you can go through this article: http://premium.wpmudev.org/manuals/wpmu-manual-2/using-mu-plugins/

    Please let us know how it goes.

    Have a nice day. Cheers!
    Rupok

  • Rupok
    • Support Ninja

    Hi Jeremy, hope you had a wonderful day.

    Sorry for little typo in my code. Can you please replace the previous code with the following?

    <?php
    add_action( 'wp_footer', 'course_list_modified' );
    function course_list_modified() {
        ?>
        <script type="text/javascript">
          jQuery(document).ready(function() {
    		if (jQuery('.archive_header').length > 0) {
    		    jQuery('.course.type-course').css({"float": "left", "width": "25%", "padding": "5px"});
    		    jQuery('.course-summary').css("display","none");
    		    jQuery('.entry-meta').css("display","none");
    		    jQuery('.course-start-date').css("display","none");
    		    jQuery('.course-language').css("display","none");
    		    jQuery('.course-cost').css("display","none");
    			jQuery('.apply-button').each(function() {
    			  var text = jQuery(this).text();
    			  jQuery(this).text(text.replace('Details', 'Read More...'));
    			});
    		}
          });
        </script>
        <?php
    }

    Your courses are shown here: http://www.langleyequinestudies.com/courses/

    Have a nice day. Cheers!
    Rupok

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.