WordPress.org

Forums

Social Articles
[resolved] Direct link to new article. (7 posts)

  1. mikesellr
    Member
    Posted 2 years ago #

    So I'm using the review it theme and so far what I have been able to collect from my theme is that my links in the header location that my code needs to be and from the other thinks the following

    <a href="<?php ?>">New Article</a> <span class="login-divider">|</span>

    So after playing around with it a bit I was able to figure out the the code so far is correct but I'm new to PHP and unsure of how to add in the <?php ?> to get a direct link to the New Article page. Thanks.

    http://wordpress.org/extend/plugins/social-articles/

  2. mikesellr
    Member
    Posted 2 years ago #

    I also found the new article array but was unable to find much on what to call out to.

    $sub_nav[] = array(
                    'name'            =>  __( 'New Article' , 'social-articles' ),
                    'slug'            => 'new',
                    'parent_url'      => $social_articles_link,
                    'parent_slug'     => SA_SLUG,
                    'screen_function' => 'new_article_screen',
                    'position'        => 20
                );
  3. Broobe
    Member
    Plugin Author

    Posted 1 year ago #

    Hi! In version 1.4, I added the direct link in the top admin bar. I hope this works for you!

    Thanks for using our plugin!

  4. mikesellr
    Member
    Posted 1 year ago #

    Unfortunately my admin bar is disabled. I would like to just move that direct link right by the user name in the top. I'm guessing I just need whatever the PHP code is to call to that.

  5. Broobe
    Member
    Plugin Author

    Posted 1 year ago #

    Hi!

    Maybe something like that:

    <?php
    $user_domain = bp_is_user() ? bp_displayed_user_domain() : bp_loggedin_user_domain();
    
    ?>
    
    <a href="<?php echo trailingslashit( $user_domain.'articles/new' )?>">New Article</a>

    Let me know if it works for you!

  6. mikesellr
    Member
    Posted 1 year ago #

    lets just say you are awesome. It worked perfectly, thank you so much.

  7. Broobe
    Member
    Plugin Author

    Posted 1 year ago #

    I'm glad that it's working! Don't forget to rate the plugin ;) Keep in touch for future updates! thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Social Articles
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic