Skip to:
Content
Pages
Categories
Search
Top
Bottom

Edit metadata post content on BP converted WP index.php

  • Hi

    My WP theme anIMass is converted to BP but I do not understand the BP code in my index.php.
    Esmi helped me ages ago convert the theme to BP.

    Today I want to add a post view counter to my post metadata content divs and have been able to do this easily on my single & page templates but I have had no success in editing this on my index.php. This is probably because I do not understand enough of the BP code in my index.php.

    Index.php

    `

     <a class="button" href="”>

    • <a href="”>
    • <a href="”>

    `

    I want to add the PostViews counter code but how?
    I have PostView code in functions.php
    This is the code for PostViews counter in single.php and page.php:
    `



    |

    `

    I am grateful for help & advice. See http://www.richard-dickinson.com
    & look forward to helpful replies-thanks

Viewing 1 replies (of 1 total)
  • UPDATE
    I have fixed this but am rather unclear why this has arisen!
    The edits I have done here have been through my Network Admin dashboard to my files.
    Everything worked except for editing index.php. When I went to my server (Hostgator via cPanel) my theme index.php was unedited!! After editing(adding) the PostView code and saving the code is now working.
    Just to highlight/emphasis the difference between the index.php I edited through Dashboard shown in my first post above here below is the index.php that exists on the server root and I edited via cPanel. They are completely different and I do not understand how/why this is the case!
    `

    <?php
    /**
    * The loop that displays posts.
    *
    * The loop displays the posts and the post content. See
    * https://codex.wordpress.org/The_Loop to understand it and
    * https://codex.wordpress.org/Template_Tags to understand
    * the tags used in it.
    *
    * This can be overridden in child themes with loop.php or
    * loop-template.php, where ‘template’ is the loop context
    * requested by a template. For example, loop-index.php would
    * be used if it exists and we ask for the loop with:
    * get_template_part( 'loop', 'index' );
    *
    * @package WordPress
    * @subpackage anIMass
    * @since anIMass 7.0
    */
    ?>

    max_num_pages > 1 ) : ?>

    <?php
    /* Start the Loop.
    *
    * In Twenty Ten we use the same loop in multiple contexts.
    * It is broken into three main parts: when we’re displaying
    * posts that are in the gallery category, when we’re displaying
    * posts in the asides category, and finally all other posts.
    *
    * Additionally, we sometimes check for whether we are on an
    * archive page, a search page, etc., allowing for small differences
    * in the loop on each template without actually duplicating
    * the rest of the loop that is shared.
    *
    * Without further ado, the loop:
    */ ?>

    <div id="post-” >

    <a href="” title=”” rel=”bookmark”>

    <?php
    $images = get_children( array( ‘post_parent’ => $post->ID, ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, ‘orderby’ => ‘menu_order’, ‘order’ => ‘ASC’, ‘numberposts’ => 999 ) );
    if ( $images ) :
    $total_images = count( $images );
    $image = array_shift( $images );
    $image_img_tag = wp_get_attachment_image( $image->ID, ‘thumbnail’ );
    ?>

    <?php printf( __( 'This gallery contains %2$s photos.’, ‘anIMass’ ),
    ‘href=”‘ . get_permalink() . ‘” title=”‘ . sprintf( esc_attr__( ‘Permalink to %s’, ‘anIMass’ ), the_title_attribute( ‘echo=0’ ) ) . ‘” rel=”bookmark”‘,
    $total_images
    ); ?>

    <a href="” title=””>
    |

    <?php edit_post_link( __( 'Edit', 'anIMass' ), '| ‘, ‘‘ ); ?>


    |

    <div id="post-” >

    <?php the_content( __( 'Continue reading ‘, ‘anIMass’ ) ); ?>

    |

    <?php edit_post_link( __( 'Edit', 'anIMass' ), '| ‘, ‘‘ ); ?>


    <div id="post-” >

    <a href="” title=”” rel=”bookmark”>

    <?php the_content( __( 'Continue reading ‘, ‘anIMass’ ) ); ?>

    ‘ ) ); ?>


    <?php printf( __( 'Posted in %2$s’, ‘anIMass’ ), ‘entry-utility-prep entry-utility-prep-cat-links’, get_the_category_list( ‘, ‘ ) ); ?>

    |

    <?php
    $tags_list = get_the_tag_list( ”, ‘, ‘ );
    if ( $tags_list ):
    ?>

    <?php printf( __( 'Tagged %2$s’, ‘anIMass’ ), ‘entry-utility-prep entry-utility-prep-tag-links’, $tags_list ); ?>

    |


    <?php edit_post_link( __( 'Edit', 'anIMass' ), '| ‘, ‘‘ ); ?>
    |
    <a href="”>Permalink


    |

    max_num_pages > 1 ) : ?>


    `

    I tried editing index.php via cPanel to the first index.php code I posted but then I got an error about “call to undefined function bp signup”
    eg
    Blogs Directory
    Fatal error: Call to undefined function bp_blog_signup_enabled() in /home/hilaryd/public_html/richard-dickinson.com/wp-content/themes/rdbloganimass_bp/index.php on line 8

    I am most grateful for further help and advice to get my blog fully BP compatible & enabled-thanks

Viewing 1 replies (of 1 total)
  • The topic ‘Edit metadata post content on BP converted WP index.php’ is closed to new replies.
Skip to toolbar