Forum Replies Created

Viewing 15 replies - 61 through 75 (of 88 total)
  • Thread Starter accend4web

    (@accend4web)

    I have resolved it by building my own page template and using that, cheers

    Thread Starter accend4web

    (@accend4web)

    In Reading:

    Front page displays is set to A static page and Front Page is kept on – Select –
    and Posts Page is set to ‘Blog’ which is the name of my page.

    Thread Starter accend4web

    (@accend4web)

    I have reduced the navbar to the forum button, its called ‘Support Forum’. You click it and if your logged out you see the log in form or register button, I can register but the re-direct doesnt work, and if i try to log in the user isnt re-directed even though I have tried to use a re-direct plugin to force it.

    The thing is also the user does get logged in, you have to refresh to see the forum, it just doesn’t re-direct, or refresh even.

    • This reply was modified 7 years, 6 months ago by accend4web.
    Thread Starter accend4web

    (@accend4web)

    No ads on the site, and it was that that made me think we had been hacked, as have had problems in the past with ads being run off sites, but not wordpress ones

    Thread Starter accend4web

    (@accend4web)

    I changed it slight having looked into it on google, and tried this below, and I cant get the date to display from the news article

    <?php $my_date = the_date( ”, ‘<h2>’, ‘</h2>’, false ); echo $my_date; ?>

    Thread Starter accend4web

    (@accend4web)

    Thanks for getting back to me, I added single.php to the child folder and then added the line of code below in what I think is the right place and I cant see the date but the ‘123’ echo’s out fine, so thats why I know I’m using the right file.

    <p><?php the_date(); ?>123</p>

    On this page you can see the ‘123’ but not the date, Im doing something wrong then by the seems.

    news page

    Thread Starter accend4web

    (@accend4web)

    Right I see thank you, what is the shortcode to display the date associated with that correct news item.

    Cheers

    Thread Starter accend4web

    (@accend4web)

    Ok I think I got it, I added this line to my child functions.php file

    add_theme_support( ‘post-thumbnails’, array( ‘post’, ‘page’ ) );

    Then in the child template and this seemed to work

    the_post_thumbnail()

    If this is wrong, be good to get that feedback

    Thread Starter accend4web

    (@accend4web)

    Might be useful sorry should have added it –

    This is what the top of each page currently looks like in the WYSIWYG

    <img class="aligncenter size-full wp-image-167" style="margin-bottom: 15px;" src="/ridgeway/wp-content/uploads/2017/01/ridgeway_CRO_tubes.jpg" alt="" />
    <div id="ridgeway_wrapper">
    <div id="ridgeway-CRO-Left">[accordionmenu id="unique043c391" accordionmenu="933"]
    <div class="leftnav_cta_below">We supply research organisations and universities with a range of parasites. See our <a style="text-decoration: underline;" title="Parasite Catalogue" href="parasite-catalogue/">Parasite Catalogue</a> for the full list</div>
    </div>
    <div id="ridgeway-CRO-Right">
    <h1>Fasciola hepatica (liver fluke)</h1>
    <h2>The life cycle of liver fluke</h2>
    Thread Starter accend4web

    (@accend4web)

    Hi guys,

    Thanks for getting back to me and looking at the time you did, you must have replied not 30 mins after I managed to work it out.

    You are seeing it correctly now, the image is showing the correct width and it all came down to a plugin called JetPack.

    I’m not sure what was going on, but for some reason it wasnt allowing a full width image to show, only the medium width.

    But thanks again for asking to help

    Thread Starter accend4web

    (@accend4web)

    I have re-downloaded the theme, made sure I’m selecting the correct template and deleted the image in the page, and added it again, saved and it still prefers to load itself smaller than what its being asked to do.

    I have cleared stuff from the child theme, such as the functions and the css and still it wont work.

    I’m pretty stumped again in honesty.

    Thread Starter accend4web

    (@accend4web)

    I have located where the code is that I need to work from and its the content-page.php file inside the template-parts folder.

    There a function in there called the_content() and maybe I dont know, its where that function is that its doing something to stop the image from showing the full width, and only allowing it show the middle with of a max of 760px, which is no good really.

    Thread Starter accend4web

    (@accend4web)

    Ah yes I got you and I did some testing.

    I turned on each plugin that was deactivated and each time refreshed the news page, and then turned the plugins off and refreshed but with the same result, my shortcode didnt work.

    There one plugin that works pretty much as I want this one too, as I have placed the shortcode in the editor part of the page as you will see in the link below, its the accordian left nav.

    ridgeway/parasite-laboratory/

    And if it helps, this is the code in the shortcode.php within that plugin folder

    <?php
    
    function accordionmenu_shortcode($atts) {
        extract(shortcode_atts(array(
            'id' => md5(time()),
            'accordionmenu' => 0,
                        ), $atts));
    
        if ($accordionmenu == 0)
            return '';
    
        $instance = array('accordionmenu' => $accordionmenu);
        $args = array('widget_id' => $id, 'instance' => $instance);
        
        require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'library' . DIRECTORY_SEPARATOR . 'accordionmenu'. DIRECTORY_SEPARATOR . 'wordpress' . DIRECTORY_SEPARATOR . 'menu.php' );
    
        $menu = new NextendMenuWordpress($args, $instance, dirname(__FILE__));
        ob_start();
        $menu->render();
        return ob_get_clean();
    }
    
    add_shortcode('accordionmenu', 'accordionmenu_shortcode');
    ?>

    And this is the shortcode that I actually place on the page

    [accordionmenu id="unique0f96695" accordionmenu="639"]

    Just to be sure I placed that shortcode on the News page and it worked fine, so is it the way I have my shortcode which to remind you is below, or more likely like you say its that I havent got that chunk of code above that allows the shortcode to work.

    [ic_add_posts category='Ridgeway Research News' showposts='3']

    • This reply was modified 8 years, 1 month ago by accend4web.
    Thread Starter accend4web

    (@accend4web)

    I’m really sorry to say this, but I’m not 100% sure what your asking, and id rather say just so that I can try it out.

    Do you mean to where that plugin is used, does the plugin work? as opposed to me trying to get my shortcode to work which doesnt work

    Thread Starter accend4web

    (@accend4web)

    I found a bunch of add_shortcode calls but they where all in the plugins folder, and as I’m not using a plugin in this instance, so that wouldnt stop it working for me, but the positive is that the plugins I have used worked, so the add_shortcode must have worked then, just not working on pages.

    Nothing dissapointingly showed up in the theme folder.

    But the one plugin I use, I have posted the code below as this one works and has the components of what Im trying to do.

    
        <?php
         
        namespace ResponsiveMenu\View;
         
        use ResponsiveMenu\Factories\CssFactory;
        use ResponsiveMenu\Factories\JsFactory;
        use ResponsiveMenu\Collections\OptionsCollection;
        use ResponsiveMenu\ViewModels\Menu;
        use ResponsiveMenu\ViewModels\Button;
         
        class FrontView implements View {
         
          public function __construct(JsFactory $js, CssFactory $css) {
            $this->js = $js;
            $this->css = $css;
          }
         
        	public function render($location, $l = []) {
            add_action('wp_footer', function() use ($location, $l) {
              include dirname(dirname(dirname(__FILE__))) . '/views/' . $location . '.phtml';
            });
        	}
         
        	public function make($location, $l = []) {
            ob_start();
              include dirname(dirname(dirname(__FILE__))) . '/views/' . $location . '.phtml';
              $output = ob_get_contents();
            ob_end_clean();
            return $output;
        	}
         
          public function echoOrIncludeScripts(OptionsCollection $options) {
         
            $css = $this->css->build($options);
            $js = $this->js->build($options);
         
            add_filter('body_class', function($classes) use($options) {
              $classes[] = 'responsive-menu-' . $options['animation_type'] . '-' . $options['menu_appear_from'];
              return $classes;
            });
         
            wp_enqueue_script('jquery');
         
            if($options['external_files'] == 'on') :
              $data_folder_dir = plugins_url(). '/responsive-menu-data';
              $css_file = $data_folder_dir . '/css/responsive-menu-' . get_current_blog_id() . '.css';
              $js_file = $data_folder_dir . '/js/responsive-menu-' . get_current_blog_id() . '.js';
              wp_enqueue_style('responsive-menu', $css_file, null, false);
              wp_enqueue_script('responsive-menu', $js_file, ['jquery'], false, $options['scripts_in_footer'] == 'on' ? true : false);
            else :
              add_action('wp_head', function() use ($css) {
                echo '<style>' . $css . '</style>';
              }, 100);
              add_action($options['scripts_in_footer'] == 'on' ? 'wp_footer' : 'wp_head', function() use ($js) {
                echo '<script>' . $js . '</script>';
              }, 100);
            endif;
          }
         
          public function addShortcode($options, Button $button, Menu $menu) {
            add_shortcode('responsive_menu', function($atts) use($options, $button, $menu) {
         
              if($atts)
                array_walk($atts, function($a, $b) use ($options) { $options[$b]->setValue($a); });
         
              $html = $this->make('button', ['options' => $options, 'button' => $button->getHtml($options)]);
         
              return $html . $this->make('menu', ['options' => $options, 'menu' => $menu->getHtml($options)]);
         
            });
          }
         
        }
         
    
    Syntax highlighting powered by GeSHi	
    Back (accesskey b)  
    

    But the bad news is that I cant find it anywhere else around the wordpress files

    • This reply was modified 8 years, 1 month ago by accend4web.
Viewing 15 replies - 61 through 75 (of 88 total)