• I have this first rate plugin applied as a widget in my navigation bar.

    How can I apply the same to a post or specifically a page?

    thanks

    w

Viewing 15 replies - 1 through 15 (of 57 total)
  • I think what you want is another plugin that will let you control widget visibility. Widget Context looks like a good one.

    Thread Starter woolfcom

    (@woolfcom)

    Trepmal

    You misunderstand I would like to have the contnet show up INSIDE my home page – not just on navigatio bar.

    I am looking for a list of the lataste post summrised on my home page and the Recent Post widget would be perfect if I could apply inside the page itself.

    Thanks for the suggestion howvever.

    w

    Okay,

    I think ideally you’d want a shortcode, right? Unfortunately, this plugin doesn’t come with one, but there is a template tag you could use in your template: <?php yg_recentposts($params); ?>. Maybe the plugin’s homepage will shed a little light?

    I’ve got my own mod of this plugin, I’ll see if I can add a shortcode feature to it – if I can, I’ll try to release it as its own plugin.

    Thread Starter woolfcom

    (@woolfcom)

    Yes indeed!

    On your link, if you are alluding the layout under the titles:

    “Advanced Most Recent Posts” yaz?s? i?in 22 Yorum

    That sort of thing would be perfect ie:

    The layout I am after is post summary with except and image [resized].

    I have this same plugin installed and its perfect.

    So yes if you do have an shortcode which would work – err are you suggesting I should try the: <?php yg_recentposts($params); ?> snippet, in the interim?

    w

    Using <?php yg_recentposts($params); ?> for now is probably the way to go, you can specify your excerpt length, image, and all the other options available in the widget inside $params (like $params = array('limit'=>3, 'excerpt'=>150, 'firstimage'=>true);) then include that inside a conditional statement so it only shows on the front page.

    I’ll try to make some time to work on a shortcode-enabled version and make that available.

    Thread Starter woolfcom

    (@woolfcom)

    I have never installed such statements before. Do I implement it in the HTML code? If so how? I’m not sure.

    Possible to have a novice walk thru of implmenting this?

    Happy to provide the page etc offline [how?]

    The code will look something like this, depending on the options you want:
    These params indicate 3 posts, 150 characters long, with an image 50×50

    <ul><?php
        if (is_front_page()) {
            $params = array('limit'=>3, 'excerpt'=>150, 'firstimage'=>true, 'w' =>50, 'h' => 50 );
            yg_recentposts($params);
        }
    ?></ul>

    This should go either in the index.php file (if your front page has posts) or page.php (if you have a static front page) wherever it is in the HTML you want the recent posts list to appear.

    Thread Starter woolfcom

    (@woolfcom)

    I have a static home page called “welcome.php” which I am editing from the dashboard.

    I use the HTML editor.

    In this way and having inserted the code block you suggested [hopefully correctly], it does not appear to work.

    Bear in mind I have “Recent Post” working as a widget on this same page.

    What are your thoughts?

    Perhaps you could copy the contents of welcome.php and put it on codepad.org? then post the link here so I can take look at the code see if there’s anything obvious.

    Thread Starter woolfcom

    (@woolfcom)

    This is a first for me,

    Hope I have done it correctly:

    https://codepad.org/DYjA3RKv

    I have not yet added the snippet you gave.

    w

    Sorry, I think I wasn’t clear, you’ll want to add that snippet to the actual theme file.

    Go to Appearance > Editor
    Select your active theme from the drop down menu.
    Choose Page Template (page.php) [some themes may use a different file]
    Add the snippet to that file [I’d look for ‘the_content(‘..’)’ and add it just below that]

    Screenshot: https://cl.ly/2KMB

    Thread Starter woolfcom

    (@woolfcom)

    The first time for me on this, I learn….

    Here’s my theme page.php

    There is one reference which resembles the_content……

    So here is page.php:

    https://codepad.org/seNNksQA

    I tried but nothing showed.

    Here’s how I would add it: https://codepad.org/xHZbwkHh

    If it’s not showing up, it’s possible that the Welcome page is set to use a non-default template. If you go edit the Welcome page, does it show anything selected for the Template? screenshot

    Thread Starter woolfcom

    (@woolfcom)

    Hey Thank you sooo much.

    I got it working!!!! I’ll play around with the variables.

    I look forward to the plugin short code – reckon it will be a winner!

    w

    Thread Starter woolfcom

    (@woolfcom)

    I have also learned some great new stuff which I thank you for particularly

    w

Viewing 15 replies - 1 through 15 (of 57 total)
  • The topic ‘Advanced Most Recent Posts’ is closed to new replies.